Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: sql_require_primary_key compatibility (#116)
* fix: sql_require_primary_key compatibility In MySQL, if the `sql_require_primary_key` is turned on, no table can exist without a primary key. Since the migration 0005 drops the primary key field before model deletion, the table misses the primary key, hence the migration will fail. To prevent migration failure, we swap the primary key before dropping the `revisionpluginrevision_ptr` field which is the actual primary key. In case the migration need to be reverted, the opposite will happen and we set the `revisionpluginrevision_ptr` as the primary key. When selecting the new primary key, it doesn't really matter what we set, since at the end of the migration we drop the whole table. Signed-off-by: Gabor Boros <[email protected]>
- Loading branch information