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
When trying to alter column of enum type to make it use the new enum type I'm getting a error from Postgres saying:
[1642] LOG: execute sqlx_s_4: ALTER TABLE "fact" ALTER COLUMN "kind" TYPE fact_kind, ALTER COLUMN "kind" SET NOT NULL
[1642] ERROR: column "kind" cannot be cast automatically to type fact_kind
[1642] HINT: You might need to specify "USING kind::fact_kind".
The part of migration causing this error looks like that:
Description
When trying to alter column of enum type to make it use the new enum type I'm getting a error from Postgres saying:
The part of migration causing this error looks like that:
Steps to Reproduce
USING
clause.Expected Behavior
Expected
ColumnDef
to be able to generate statement which includes the extraUSING
clause followed with explicit column and its type – https://www.postgresql.org/docs/current/ddl-alter.html#DDL-ALTER-COLUMN-TYPE , or optionally followed by expressioncolumn_name::text::type_name
to use thru-text cast.Actual Behavior
The SQL appears to be generated without
USING
clause (PostgreSQL refuses to convert existing data to implicit type without it).Reproduces How Often
Reproduced always.
Workarounds
Write raw SQL by hand.
Versions
sea-orm-migration 0.12.15
The text was updated successfully, but these errors were encountered: