Skip to main content

parse_composite_unique_attribute

Function parse_composite_unique_attribute 

Source
pub fn parse_composite_unique_attribute(
    raw: &str,
) -> Result<Vec<String>, String>
Expand description

Parses @@unique([field1, field2, ...]) into its ordered list of local field names. Callers are responsible for checking that each name resolves to a real scalar field on the model.

The order is significant: it is the column order of the emitted unique index, and it feeds the index name (<table>_<col1>_<col2>_key), so reordering the list is a rename.