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 am using DeriveIden to rename postgresql enum to camel case. I was able to create the Enum type correctly. But manager.create_table spat an error complaining my enum type(in lowercase) does not exist.
Steps to Reproduce
create a migration
run sea-orm-cli -v migrate up
error message occurs
exam the migration log and see that enum type name in create table statement is not wrapped by double quote.
Actual Behavior
enum type name in create table statement is not wrapped by double quote.
CREATETABLEIF NOT EXISTS "test_table" ("id"serialNOT NULLPRIMARY KEY, "test_enum" TestEnum)
Expected Behavior
enum type name in create table statement should be wrapped by double quote.
CREATETABLEIF NOT EXISTS "test_table" ("id"serialNOT NULLPRIMARY KEY, "test_enum""TestEnum")
2024-10-29T15:49:05.326486Z INFO sqlx::postgres::notice: relation "seaql_migrations" already exists, skipping
2024-10-29T15:49:05.327650Z INFO sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS \"seaql_migrations\" (\n \"version\" varchar NOT NULL PRIMARY KEY,\n \"applied_at\" bigint NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=7.675334ms elapsed_secs=0.007675334
2024-10-29T15:49:05.327716Z INFO sea_orm_migration::migrator: Applying all pending migrations
2024-10-29T15:49:05.330810Z INFO sqlx::postgres::notice: relation "seaql_migrations" already exists, skipping
2024-10-29T15:49:05.331607Z INFO sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS \"seaql_migrations\" (\n \"version\" varchar NOT NULL PRIMARY KEY,\n \"applied_at\" bigint NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=3.085167ms elapsed_secs=0.003085167
2024-10-29T15:49:05.334122Z INFO sqlx::postgres::notice: relation "seaql_migrations" already exists, skipping
2024-10-29T15:49:05.334960Z INFO sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS \"seaql_migrations\" (\n \"version\" varchar NOT NULL PRIMARY KEY,\n \"applied_at\" bigint NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=2.508959ms elapsed_secs=0.002508959
2024-10-29T15:49:05.338076Z INFO sqlx::postgres::notice: relation "seaql_migrations" already exists, skipping
2024-10-29T15:49:05.338877Z INFO sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS \"seaql_migrations\" (\n \"version\" varchar NOT NULL PRIMARY KEY,\n \"applied_at\" bigint NOT NULL\n)\n" rows_affected=0 rows_returned=0 elapsed=3.036208ms elapsed_secs=0.003036208
2024-10-29T15:49:05.348089Z INFO sqlx::query: summary="SELECT \"version\", \"applied_at\" FROM …" db.statement="\n\nSELECT\n \"version\",\n \"applied_at\"\nFROM\n \"seaql_migrations\"\nORDER BY\n \"version\" ASC\n" rows_affected=0 rows_returned=0 elapsed=8.770958ms elapsed_secs=0.008770958
2024-10-29T15:49:05.348180Z INFO sea_orm_migration::migrator: Applying migration 'm20220101_000001_create_table'
2024-10-29T15:49:05.357283Z INFO sqlx::query: summary="CREATE TYPE \"TestEnum\" AS …" db.statement="\n\nCREATE TYPE \"TestEnum\" AS ENUM ('a', 'b')\n" rows_affected=0 rows_returned=0 elapsed=8.688584ms elapsed_secs=0.008688584
2024-10-29T15:49:05.364974Z INFO sqlx::query: summary="CREATE TABLE IF NOT …" db.statement="\n\nCREATE TABLE IF NOT EXISTS \"test_table\" (\n \"id\" serial NOT NULL PRIMARY KEY,\n \"test_enum\" TestEnum\n)\n" rows_affected=0 rows_returned=0 elapsed=6.936ms elapsed_secs=0.006936
Execution Error: error returned from database: type"testenum" does not exist
Fail to run migration
Description
I am using DeriveIden to rename postgresql enum to camel case. I was able to create the Enum type correctly. But manager.create_table spat an error complaining my enum type(in lowercase) does not exist.
Steps to Reproduce
Actual Behavior
enum type name in create table statement is not wrapped by double quote.
Expected Behavior
enum type name in create table statement should be wrapped by double quote.
Reproduces How Often
whenever creating table with camel case enum type
Reproducible Example
Version
sea-orm-cli 1.1.0
>postgres -V postgres (PostgreSQL) 14.13 (Ubuntu 14.13-0ubuntu0.22.04.1)
The text was updated successfully, but these errors were encountered: