Вопрос

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

Это было полезно?

Решение

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

Другие советы

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

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top