go-gorm / postgres

GORM PostgreSQL driver
MIT License
234 stars 123 forks source link

fix: create index failed without err #285

Closed zhangzhiqiangcs closed 1 month ago

zhangzhiqiangcs commented 1 month ago

What did this pull request do?

Check index exists after create index. If not exists, return the err.

We run into this case, because we use the same index name for difference table, and the migration executed successfuly. But when use do some request, we got a err ERROR: there is no unique or exclusion constraint matching the ON CONFLICT specification (SQLSTATE 42P10 becase we must make sure the index exists.