EF Core 6 - Create table if not exists by means of Add-Migration
Hi,
Let's say I've a database with tables A, B and C.
When from packet manager console I issue
The database is correctly created. Howerver, if later on I add a table D to my DbContext, remove previously created migrations and I run
The second command fails with error message
Is there a way to only add not-existing tables (i.e. create if not exists) using migrations?
2 Replies
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Thanks, it worked! it was so simple and I wasted about a day after it... 🤦♂️