From 31ef8c76dff33055c166beb5ed7440d168a254c9 Mon Sep 17 00:00:00 2001 From: Sebastian Goll <1277035+sgoll@users.noreply.github.com> Date: Fri, 4 Oct 2024 11:41:46 +0200 Subject: [PATCH] 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 --- sea-orm-migration/src/schema.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sea-orm-migration/src/schema.rs b/sea-orm-migration/src/schema.rs index dda97bcf4..67447441d 100644 --- a/sea-orm-migration/src/schema.rs +++ b/sea-orm-migration/src/schema.rs @@ -543,11 +543,11 @@ pub fn uuid_uniq(col: T) -> ColumnDef { uuid(col).unique_key().take() } -pub fn custom(col: T, name: T) -> ColumnDef { +pub fn custom(col: T, name: N) -> ColumnDef { ColumnDef::new(col).custom(name).not_null().take() } -pub fn custom_null(col: T, name: T) -> ColumnDef { +pub fn custom_null(col: T, name: N) -> ColumnDef { ColumnDef::new(col).custom(name).null().take() }