воскресенье, 5 апреля 2015 г.

EntityFramework [DatabaseGenerated(DatabaseGeneratedOption.Computed)]

http://stackoverflow.com/questions/23413625/entity-framework-default-datetime-annotation-does-not-migrate


 AddColumn("dbo.Specialty", 
                  "CreatedDate", 
                  c => c.DateTime(defaultValueSql: "GETDATE()"));

Отменить Migration и включить автоматическую Migration

http://stackoverflow.com/questions/11679385/reset-entity-framework-migrations

You need to delete the state:
  1. Delete the migrations folder in your project
  2. Delete the __MigrationHistory table in your database (may be under system tables)
Then run the following command in the Package Manager Console:
Enable-Migrations -EnableAutomaticMigrations -Force
And finally, you can run:
Add-Migration Initial

Комментариев нет:

Отправить комментарий