In my use case, in sqlite driver, I have a model Gateway with a composite unique index defined on the fields IP and UIN. I expect that when running AutoMigrate, the table should only be recreated if there are changes to the model structure. However, I observed that the table is recreated every time AutoMigrate is called, even when the model has not changed.
Expected results:
When using a composite unique index, the table should not be recreated during AutoMigrate if the model structure has not changed.
The unique attribute should be properly set for fields within a composite unique index, without affecting the behavior of AutoMigrate.
After modifying the condition in the sqlite-driver code as mentioned in the original issue description, the behavior is as expected and the table is not recreated during AutoMigrate when the model has not changed.
Explain your user case and expected results
In my use case, in sqlite driver, I have a model Gateway with a composite unique index defined on the fields IP and UIN. I expect that when running AutoMigrate, the table should only be recreated if there are changes to the model structure. However, I observed that the table is recreated every time AutoMigrate is called, even when the model has not changed.
Expected results:
When using a composite unique index, the table should not be recreated during AutoMigrate if the model structure has not changed. The unique attribute should be properly set for fields within a composite unique index, without affecting the behavior of AutoMigrate. After modifying the condition in the sqlite-driver code as mentioned in the original issue description, the behavior is as expected and the table is not recreated during AutoMigrate when the model has not changed.