diff --git a/src/entity/column.rs b/src/entity/column.rs index e31af001..de98c0d7 100644 --- a/src/entity/column.rs +++ b/src/entity/column.rs @@ -227,6 +227,23 @@ impl ColumnType { } } +impl ColumnDef { + pub fn unique(mut self) -> Self { + self.unique = true; + self + } + + pub fn null(mut self) -> Self { + self.null = true; + self + } + + pub fn indexed(mut self) -> Self { + self.indexed = true; + self + } +} + impl Into for ColumnType { fn into(self) -> sea_query::ColumnType { match self {