Skip to content

Commit

Permalink
Allow distinct types in schema::custom() (#2326)
Browse files Browse the repository at this point in the history
* Allow distinct types in schema::custom()

* Allow `custom_null` to take column name and alias of different `IntoIden` types

---------

Co-authored-by: Billy Chan <[email protected]>
  • Loading branch information
sgoll and billy1624 authored Oct 4, 2024
1 parent cb5520e commit 31ef8c7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions sea-orm-migration/src/schema.rs
Original file line number Diff line number Diff line change
Expand Up @@ -543,11 +543,11 @@ pub fn uuid_uniq<T: IntoIden>(col: T) -> ColumnDef {
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()
}

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()
}

Expand Down

0 comments on commit 31ef8c7

Please sign in to comment.