Codegen compact-format generate unique attribute

This commit is contained in:
Billy Chan 2021-09-24 15:45:22 +08:00
parent 37b36eb101
commit 360436ceac
No known key found for this signature in database
GPG Key ID: A2D690CAC7DF3CC7

View File

@ -346,6 +346,9 @@ impl EntityWriter {
attrs.push(quote! { nullable });
}
};
if col.unique {
attrs.push(quote! { unique });
}
if !attrs.is_empty() {
let mut ts = TokenStream::new();
for (i, attr) in attrs.into_iter().enumerate() {