Clavat
Clavat

Reputation: 117

dotnet core generate migration script with data seed

I'm in .Net Core 3.1 C#. I would like to deploy my application to a IIS test server, I can't use CLI on this server so I generated my SQL script with this command : dotnet ef migrations script

The produced SQL file contains only the database schema, not any seed data, despite in local when I run the commande Update-Database My database is initialized with seed data...

How to generate SQL script with seed data ?

Thanks.

Upvotes: 0

Views: 1310

Answers (1)

Clavat
Clavat

Reputation: 117

After searching on internet, I found the last command I looking for :

  Add-Migration SeedInitialData
  Update-Database
  Script-Migration

Last command will generate the needed SQL file.

Upvotes: 1

Related Questions