From 99ef2269afb34f9afbfbec791ca7056a4b1ce572 Mon Sep 17 00:00:00 2001 From: Sebastian Goll Date: Sun, 11 Aug 2024 14:25:42 +0200 Subject: [PATCH 1/2] Allow distinct types in schema::custom() --- sea-orm-migration/src/schema.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sea-orm-migration/src/schema.rs b/sea-orm-migration/src/schema.rs index 47ecd05d6..83886080a 100644 --- a/sea-orm-migration/src/schema.rs +++ b/sea-orm-migration/src/schema.rs @@ -538,7 +538,7 @@ 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() } From bfeb23b7cc6e37891f68aac856f8e76ac7e19adf Mon Sep 17 00:00:00 2001 From: Billy Chan Date: Fri, 4 Oct 2024 17:39:46 +0800 Subject: [PATCH 2/2] Allow `custom_null` to take column name and alias of different `IntoIden` types --- sea-orm-migration/src/schema.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sea-orm-migration/src/schema.rs b/sea-orm-migration/src/schema.rs index 83886080a..dfd62b320 100644 --- a/sea-orm-migration/src/schema.rs +++ b/sea-orm-migration/src/schema.rs @@ -542,7 +542,7 @@ 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() }