I am trying to split off a read-only, heavily used auditing table from the rest of the database. Putting it in a filegroup and seperate file seems the best solution.
However I cannot figure out how to set this up in entity framework, do I need to manually drop and create the table and target the constraints to the filegroup?
Currently I am using migrations to create the database and tables:
CreateTable(
"dbo.audi_auditing",
c => new
{
audi_id = c.Int(nullable: false, identity: true),
audi_id_first = c.String(maxLength: 20),
audi_id_second = c.String(maxLength: 20),
audi_data = c.String(storeType: "xml"),
tent_id = c.Int(),
audy_id = c.Int(nullable: false),
audi_created = c.DateTime(nullable: false, precision: 0, storeType: "datetime2"),
audi_created_by = c.String(nullable: false, maxLength: 50),
})
.PrimaryKey(t => t.audi_id)
.ForeignKey("dbo.tabe_table_entity", t => t.tent_id)
.ForeignKey("dbo.audy_audit_type", t => t.audy_id, cascadeDelete: true)
.Index(t => t.audi_id_first)
.Index(t => t.audi_id_second)
.Index(t => t.tent_id)
.Index(t => t.audy_id)
.Index(t => t.audi_created)
.Index(t => t.audi_created_by);
Related: How do i move a table to a particular FileGroup in SQL Server 2008