How do I get EF to build all the tables for the prod db?
So far I've been building and pushing all my .Net Core database migrations to the dev db
ex.
>dotnet ef migrations add InitialModsN -c Auto2Context
>dotnet ef database update -c Auto2Context
In my Appsettings.Development.json file I have my con string pointing to dev db 'source=DEV'
"ConnectionStrings": {
"DefaultConnection": "Data Source=Auto2.db",
"Auto2": "data source=DEV; initial catalog=Auto2; user id=auto2; password=12345;" }
And my Appsettings.json I have the prod db con string pointing to the prod db 'source=LIVE'
"ConnectionStrings": {
"DefaultConnection": "Data Source=Auto2.db",
"Auto2": "data source=LIVE; initial catalog=Auto2; user id=auto2; password=12345;" }
So far everything is being built and migrated to dev, how do I change this to build all the changes up to date in the prod db?
Do I have to re create an initial migration file and then update? If yes, how do I point it to the prod db? I tried a couple of different commands with no luck. Here is what I tried.
>dotnet ef database update -c Auto2Context --connection "data source=LIVE; initial catalog=Auto2; user id=auto2; password=12345"
-received 'Unrecognized option '--connection''
>dotnet ef database update -c Auto2Context --configuration Release
- no tables created in the prod db