My application has a one context that is injected using Autofac. I also have plugins which created and maintained their own contexts on the same database. I'm bringing it all in-line now so that the plugins just use the main context.
The issue I now face is that because the tables already exist in the database, I can't update-database
because it says PluginTable
already exists in the database. I can't do an add-migration
and then remove the Up / Down entries because the plugins aren't within the same project.
Note: I think this is only an issue because the tables already exist so I need to get the current migration entries up to date so it doesn't try and recreate the tables.
Note: I considered re-building the migration file but again, the same problem will happen because add migration doesn't work.
I don't know what code to post that will help with this but I'm just wondering if we can tell ef to ignore tables that already exist on its creation process (this sounds daft as I type it but I'm not sure what else to do).
EDIT: Perhaps the question I should be asking is how to get the add-migration
to take note of the other projects so I can just do a blank add migration and get the migration file up to date