3 ms·
.net has entity framework an ORM has has migrations. It isn't problem free, but we found workable solutions to our issues. By default EF will throw an error if
by aerojoe23 7y ago
.net has entity framework an ORM has has migrations. It isn't problem free, but we found workable solutions to our issues.
By default EF will throw an error if the model (in code) and the database are out of sync. There is a setting you can set to tell the ef not to care about the version, but then you have to take the responsibility of making sure the old code will run against the new db version.
Most of our stuff is adding a new column or table so the old code doesn't rely on it and everything goes fine anyway.
- sebazzz 7y agoYes, we have used that for a bit and for the most part this works fine. We had however a case where several migrations were not applied in production, and that is a mess to figure out. But the development experience, especially at the start of the project (if you don't maintain your seeding code), is awesome. You just point the project at an empty or non-existing database, the schema is automatically created, and any necessary base data can automatically be seeded.
- ozim 7y agoBut that is most important part of migrations to throw that error so you are aware of it. First thing you fix your db and then push to test server, and you never have broken db on production, NEVER.