Starting with gorm 1.25.6 I can't automatically migrate tables with uniqueIndex constraint. Here's a very simple example with just one model and one field with the constraint. I removed DROP TABLE commands, so the database keeps the data between the test runs.
Now if you run the test the first time - it passes, if you run it again - you get the error:
Failed to auto migrate, but got error Error 1091 (42000): Can't DROP 'uni_entities_name'; check that column/key exists
This is tested with 1.25.9 and fails there. Works fine in 1.25.5, started failing in 1.25.6.
Tested with MySQL and fails there. Seems working OK with sqlite3 though...
Explain your user case and expected results
Starting with gorm 1.25.6 I can't automatically migrate tables with
uniqueIndex
constraint. Here's a very simple example with just one model and one field with the constraint. I removedDROP TABLE
commands, so the database keeps the data between the test runs.Now if you run the test the first time - it passes, if you run it again - you get the error:
This is tested with 1.25.9 and fails there. Works fine in 1.25.5, started failing in 1.25.6.
Tested with MySQL and fails there. Seems working OK with sqlite3 though...