You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to make Postgresql citext column with migration and generate entity with sea-orm-cli generate entity.
Migration up:
manager
.get_connection().execute_unprepared("CREATE EXTENSION IF NOT EXISTS citext").await?;
manager
.create_table(Table::create().table(User::Table).if_not_exists().col(ColumnDef::new(User::Id).uuid().not_null().primary_key()).col(ColumnDef::new(User::Email).custom(Alias::new("citext")).not_null().unique_key(),).to_owned(),).await?;
DatabaseError occurred: Query Error: error occurred while decoding column "email": mismatched types; Rust type `core::option::Option<alloc::string::String>` (as SQL type `TEXT`) is not compatible with SQL type `citext`
If I edit the entity to this the error doesn't occurs:
Motivation
I was trying to make Postgresql
citext
column with migration and generate entity withsea-orm-cli generate entity
.Migration up:
sea-orm-cli generate entity -o src/entity
generates:When I try to select the user, this error occurs:
If I edit the entity to this the error doesn't occurs:
Proposed Solutions
Able to set
select_as
,save_as
in migration.Current Workarounds
Edit the entity manually when I generate it.
The text was updated successfully, but these errors were encountered: