C#
C#

help

Root Question Message

VINI JR
VINI JR10/24/2022
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.
VINI JR
VINI JR10/24/2022
If someone could suggest me something
Message Not Public

Sign In and Join Server To See

10/25/2022
Cisien
Cisien10/25/2022
EnsureCreated wont update an existing database, instead you will need to call Migrate, which creates if it doesnt exist.
Cisien
Cisien10/25/2022
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
Message Not Public

Sign In and Join Server To See

10/25/2022
Cisien
Cisien10/25/2022
Its new as of 6, iirc
VINI JR
VINI JR10/25/2022
VINI JR
VINI JR10/25/2022
doing like this its impossible versioning it. Do you have an idea of how do it
ContactFrequently Asked QuestionsJoin The DiscordBugs & Feature RequestsTerms & Privacy