Don't create redundant unique indexes on PG and SQLite#2950
Don't create redundant unique indexes on PG and SQLite#2950tyt2y3 merged 1 commit intoSeaQL:masterfrom
Conversation
2b732ca to
892e327
Compare
tyt2y3
left a comment
There was a problem hiding this comment.
thank you for the fix! it seems correct, can you briefly explain the root cause of the issue and the fix?
why is this applicable to SQLite as well?
|
Postgres and SQLite both automatically create indexes for
|
| let column_def = column.def(); | ||
|
|
||
| if column_def.indexed || column_def.unique { | ||
| if column_def.indexed || (column_def.unique && backend == DbBackend::MySql) { |
There was a problem hiding this comment.
It’d help to add a comment here to explain why we filter pg/sqlite out.
|
In the process of writing the requested comment, I got to thinking and did some checking, and it seems like MySQL also automatically creates an index from a UNIQUE constraint. I'm not sure where I got the idea that this was a MySQL-specific workaround. Perhaps the correct fix is simply to remove |
|
Or even |
let's do this. I will make the change |
PR Info
Bug Fixes