We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If I use
ColumnDef::new(Items::Children) .not_null() .array(ColumnType::Uuid) .default(Value::Array(ArrayType::Uuid, Some(Box::default())))
to try to build a field with an empty array as the default value, the generated SQL is:
ALTER TABLE "items" DROP COLUMN "children", ADD COLUMN "children" uuid[] NOT NULL DEFAULT ARRAY []%
This made it impossible to construct this field via regular ORM operations, and I had to use SimpleExpr::Custom.
SimpleExpr::Custom
The normal operation should be ALTER TABLE "items" DROP COLUMN "children", ADD COLUMN "children" uuid[] NOT NULL DEFAULT ARRAY[]::uuid[].
ALTER TABLE "items" DROP COLUMN "children", ADD COLUMN "children" uuid[] NOT NULL DEFAULT ARRAY[]::uuid[]
Migrator will encounter an error Execution Error: error returned from database: cannot determine type of empty array.
Execution Error: error returned from database: cannot determine type of empty array
I'm currently using the version 1.1.2, but this operation is unavailable in all versions.
The text was updated successfully, but these errors were encountered:
This issue has been raised at SeaQL/sea-query#853 and #2068 and implemented at SeaQL/sea-query#854, but it has not been merged.
Sorry, something went wrong.
No branches or pull requests
Description
If I use
to try to build a field with an empty array as the default value, the generated SQL is:
This made it impossible to construct this field via regular ORM operations, and I had to use
SimpleExpr::Custom
.Expected Behavior
The normal operation should be
ALTER TABLE "items" DROP COLUMN "children", ADD COLUMN "children" uuid[] NOT NULL DEFAULT ARRAY[]::uuid[]
.Actual Behavior
Migrator will encounter an error
Execution Error: error returned from database: cannot determine type of empty array
.Versions
I'm currently using the version 1.1.2, but this operation is unavailable in all versions.
The text was updated successfully, but these errors were encountered: