We are working on a project that uses Entity Framework 4 (code-first) and Fluent Migrator.
In going throughout the project, we've created migrations for all of our schema changes and profiles for test-data that we want populated in our various environments.
However, what is the best practice for inserting "codes" and/or "statuses" that we want populated in all of our environments? Should we specify them during the creation of the tables or should we create a specific profile for them?
To be more specific, we have a "code" table for Address Types defined for our database like so:
[Migration(22)]
public class M0022_CreateAddressTypesTable : Migration
{
public override void Up()
{
Create.Table("AddressTypes")
.WithColumn("Id").AsInt32().NotNullable().PrimaryKey()
.WithColumn("Name").AsString(50).NotNullable().WithDefaultValue(string.Empty)
.WithColumn("Description").AsString(100).NotNullable().WithDefaultValue(string.Empty);
}
public override void Down()
{
Delete.FromTable("AddressTypes");
Delete.Table("AddressTypes");
}
}
So, should we use this chance to also populate the AddressTypes table with our data? Or should we abstract that away into a profile of some sort?
I see benefits and disadvantages of both, so I'd love to hear how other teams are handling this type of situation.