I am trying to initially create a sql server db schema for my azure application with code first migrations (as described here).
The basic creation of my tables works, however the azure (entitydata) specific things don't. There is no default value for CreatedAt, no UpdatedAt Trigger and also a problem with a clustered index. This happens to all of my tables. Thats what i am doing (shows the problem for 1 Table Account):
public Configuration()
{
AutomaticMigrationsEnabled = false;
SetSqlGenerator("System.Data.SqlClient", new EntityTableSqlGenerator());
}
var migrator = new DbMigrator(new Configuration());
migrator.Update();
The up-Method in my DBMigration-Class looks as follows:
CreateTable(
"dbo.Accounts",
c => new
{
Id = c.String(nullable: false, maxLength: 128),
Username = c.String(nullable: false, maxLength: 30),
Salt = c.Binary(),
SaltedAndHashedPassword = c.Binary(),
MailAddress = c.String(),
FacebookId = c.String(),
Version = c.Binary(nullable: false, fixedLength: true, timestamp: true, storeType: "rowversion"),
CreatedAt = c.DateTimeOffset(nullable: false, precision: 7),
UpdatedAt = c.DateTimeOffset(precision: 7),
Deleted = c.Boolean(nullable: false),
})
.PrimaryKey(t => t.Id)
.Index(t => t.CreatedAt, clustered: true);
I thought, that the EntityTableSqlGenerator should do these azure specific things, however it seems that it changes nothing.