Fredrick Lackey - 134 - Feb 25, 2014

Will the ORM gracefully create foreign keys, pointing to newly added tables, to existing tables during dev?  I have a method in my repo assembly, called “CreateTables”, which is called once per the life of the assembly.  It would be great to not have to seed the database unless the schema significantly changes.

No, if you use db.CreateTableIfNotExists<Table>() it will only create the schema for tables that don’t exist, it doesn’t try to merge the schema with the active database.

The way I’m doing it now is to put all my DDL in a “MigrationsTests” unit test so they’re replay-able, where I first run them against my test db, then when it everything’s ok run them against the live db. When I have more time I’d like to improve this story.