Default columns of __EFMigrationsHistory
Proposal: change default columns of __EFMigrationsHistory table to:
Id, MigrationName, MigrationSource, Created
Where
Id - hash (for ex. sha1) from MigrationSource
MigrationName - name of migration.
MigrationSource - sql representation of migration.
Created - date, when migration was applied to database.
With this columns, it would be possible
- See what migrations were applied, without having source code (so this will be good for admins, that have no access to the source code).
- Apply same migration several times.
- By
Idhash developer will always know what migration was and when applied even ifMigrationSourcenot included into database by security restrictions. - Migrations can have the same names, but with different source code, of different names with the same source code.
@bricelam to follow up.
This sounds like too fundamental of a change for us to consider. Applications, however, are free to add columns to the history table. See Custom Migrations History Table. With this, you could achieve most of what you propose.
Note, issue #2532 is also about storing SQL (the down script) in the table.
We would still certainly consider improving the Migrations experience based on specific feedback from teams using Migrations. Our current approach has been used since 2011, and we haven't heard much feedback regarding the issues you've listed.