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
Knex version: 3.0.1
Database + version: postgres
OS: all
Bug
Explain what kind of behaviour you are getting and how you think it should do
When creating and dropping a unique constraint with a predicate the api doesn't behave the same way
Error message
Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
knex.schema.table('my_table', (table) => {
table.unique(['my_column'], {predicate: knex.whereRaw('"my_column" IS NOT NULL')})
});
Results in
create unique index "my_table_my_column_unique" on "my_table" ("my_column")
where
"my_column" IS NOT NULL
Environment
Knex version: 3.0.1
Database + version: postgres
OS: all
Bug
Explain what kind of behaviour you are getting and how you think it should do
When creating and dropping a unique constraint with a predicate the api doesn't behave the same way
Error message
Reduced test code, for example in https://npm.runkit.com/knex or if it needs real
database connection to MySQL or PostgreSQL, then single file example which initializes
needed data and demonstrates the problem.
Results in
And
results in
which fails because there's no constraint, but an index by the name of "my_table_my_column_unique"
The text was updated successfully, but these errors were encountered: