go-gorm / playground

GORM Playground (Please Create PR for this project to report issues)
MIT License
89 stars 685 forks source link

DropIndex and RenameIndex fail in postgres driver when TablePrefix is… #675

Open GordonFremen opened 9 months ago

GordonFremen commented 9 months ago

… used to specify schema

Explain your user case and expected results

To reproduce the issue for each function, comment in the respective block in TestGORM. run tests with the dialect set to "postgres" as there is dialect-specific SQL used to create the non-default schema.

I would expect that these two functions would use m.CurrentTable to table TablePrefix into account, but they do not. Explicitly adding the schema to the index name in the function argument makes these tests work, which confirms the cause.