VS12Pro, EF 5, steps to recreate:
- create class with custom primary [Key]
- create database
- enable migration
- result: table with correct primary key NOT NULL, but identity = false
- add [DatabaseGenerated(DatabaseGeneratedOption.Identity)] to primary key property
- run add-migration
- result: still identity = false, migration class: Up() and Down() are empty
The same is true for switching identity off on an existing column too.
- create class with custom primary [Key]
- create database
- enable migration
- result: table with correct primary key NOT NULL, but identity = false
- add [DatabaseGenerated(DatabaseGeneratedOption.Identity)] to primary key property
- run add-migration
- result: still identity = false, migration class: Up() and Down() are empty
The same is true for switching identity off on an existing column too.