❔ What could possibly be the reason when I run database -update but no tabled added ?
Pretty much as the title says, I run the command as in the image wanting to update my new created entity into my database, but when I check the database, there's no new table added, can someone help me what could possibly go wrong here ?
9 Replies
did you
Add-Migration
before?
this should add a migration with all the changes since the last migration was created
after that you can Update-Database
to apply the new migration to the database (creating the new table)i did, I have this migration
that doesn't look right (the methods should have code in them)
did you add a
DbSet<...>
for your new type to your dbcontext?im not sure I've made any action on my dbcontext, I'll check it then
you should have something like this in ur class "nameDBContext"
Then you override the method OnModelCreating(ModelBuilder modelBuidler)
and configure each table with each property definitions
in my case i do this:
up to you how should it look
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.