JasperFx / weasel

Database Development Made Easy for .Net
MIT License
65 stars 21 forks source link

PK columns with FK constraints don't migrate #45

Open tonykaralis opened 2 years ago

tonykaralis commented 2 years ago

This bug was found when fixing #43.

One suggestion was to drop all foreign keys then recreate them in order to allow for the primary keys to be migrated. @oskardudycz suggested a better alternative whereby we simply disable the constraints, run migrations and then re-enable them after, see https://stackoverflow.com/a/49584660/10966454.

Commit with failing test, https://github.com/tonykaralis/weasel/commit/6b159f3eae281e92065f358823ec6df5327273a3.