Entity Framework - Migrations Production (Postgres)
I'm using this approach: Create database model -> Create OnModelCreating -> dotnet ef migrations add AND dotnet ef database update
But it aint suitable for production. I need to do something on startup.
7 Replies
If someone could suggest me something
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
EnsureCreated wont update an existing database, instead you will need to call Migrate, which creates if it doesnt exist.
Instead of creating your own console app, ef has the ability to generate a migration bundle for you, which you can execute manually or as part of your ci/cd. Ef can also generate sql scripts that you can run
Unknown User•3y ago
Message Not Public
Sign In & Join Server To View
Its new as of 6, iirc
doing like this its impossible versioning it. Do you have an idea of how do it