Pergunta

does anyone know how you can seed a specific update using EF 5 migrations? I have existing database, alredy has lookups populated, and am developing some Audit functionality. I have created an AuditType entity and Audit. When I call update-database, I don't want all my seed data from when I first created the database to be re-added. Do I simply have to manuall delete the existing seed data out or can I do something like name a Configuration.cs with the datetime similar to what gets created when I call add-migration?

Thanks

Foi útil?

Solução

You can run a specific migration by specifying the name of the migration. For example, If you have a migration called MyTuesdayMigration.cs, In the package manager console, you would run this command:

update-database -TargetMigration MyTuesdayMigration

Outras dicas

You may need to delete data so you should use -fore update-database -TargetMigration MigrationName -force

Licenciado em: CC-BY-SA com atribuição
Não afiliado a StackOverflow
scroll top