ColumnDef

This commit is contained in:
Chris Tsang 2021-06-19 21:06:12 +08:00
parent 91023d06c5
commit 564c6ed1a2

View File

@ -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<sea_query::ColumnType> for ColumnType { impl Into<sea_query::ColumnType> for ColumnType {
fn into(self) -> sea_query::ColumnType { fn into(self) -> sea_query::ColumnType {
match self { match self {