I am using Entity Framework 7 and I would like to rename
"__EFMigrationsHistory"
table name to
"__Migrations".
So I have the following on my context:
protected override void OnModelCreating(ModelBuilder builder) {
base.OnModelCreating(builder);
builder
.Entity<HistoryRow>()
.ToTable("__Migrations")
.HasKey(x => x.MigrationId);
// Remaining configuration
}
I am able to create the migration but when I apply it to the database I get:
There is already an object named 'PK_HistoryRow' in the database.
Could not create constraint or index. See previous errors.
I have been trying a few options but I always end with a problem.
Does anyone knows the best way to do this?