Allow distinct types in schema::custom()
(#2326)
* Allow distinct types in schema::custom() * Allow `custom_null` to take column name and alias of different `IntoIden` types --------- Co-authored-by: Billy Chan <ccw.billy.123@gmail.com>
This commit is contained in:
parent
cb5520eb67
commit
31ef8c76df
@ -543,11 +543,11 @@ pub fn uuid_uniq<T: IntoIden>(col: T) -> ColumnDef {
|
|||||||
uuid(col).unique_key().take()
|
uuid(col).unique_key().take()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn custom<T: IntoIden>(col: T, name: T) -> ColumnDef {
|
pub fn custom<T: IntoIden, N: IntoIden>(col: T, name: N) -> ColumnDef {
|
||||||
ColumnDef::new(col).custom(name).not_null().take()
|
ColumnDef::new(col).custom(name).not_null().take()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn custom_null<T: IntoIden>(col: T, name: T) -> ColumnDef {
|
pub fn custom_null<T: IntoIden, N: IntoIden>(col: T, name: N) -> ColumnDef {
|
||||||
ColumnDef::new(col).custom(name).null().take()
|
ColumnDef::new(col).custom(name).null().take()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user