C
C#9mo ago
Djinn

❔ EFCore migrations from existent database

i have working EFcore msyql setup but i want start keep migrations tracking from now. How create migration from existensing database? I got this errors like table already existis. https://media.discordapp.net/attachments/915295042862710835/1155233428590055535/image.png
No description
4 Replies
chilldog
chilldog9mo ago
try using dotnet ef database update <nameOfYourMigration>, this will let ef core know that your initial migration has been applied. and also the other big thing is just making sure you dbcontext and entities match the db, but seems like they are if you got this error. you create the migration with dotnet ef migrations add InitCreate. you also probably want to make a Persistence project that tracks these migrations for you
Accord
Accord9mo ago
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.
chilldog
chilldog9mo ago
Bruh
Accord
Accord9mo ago
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.