43 lines
1.4 KiB
C#
43 lines
1.4 KiB
C#
|
namespace Weee.Migrations
|
||
|
{
|
||
|
using System;
|
||
|
using System.Data.Entity.Migrations;
|
||
|
|
||
|
public partial class add_UserLCADocExcelTemplate_and_DocExcelTemplate_tables : DbMigration
|
||
|
{
|
||
|
public override void Up()
|
||
|
{
|
||
|
CreateTable(
|
||
|
"dbo.DocExcelTemplates",
|
||
|
c => new
|
||
|
{
|
||
|
ID = c.Int(nullable: false, identity: true),
|
||
|
FileName = c.String(),
|
||
|
})
|
||
|
.PrimaryKey(t => t.ID);
|
||
|
|
||
|
CreateTable(
|
||
|
"dbo.UserLCADocExcelTemplates",
|
||
|
c => new
|
||
|
{
|
||
|
ID = c.Int(nullable: false, identity: true),
|
||
|
UserID = c.String(nullable: false, maxLength: 128),
|
||
|
TemplateID = c.Int(nullable: false),
|
||
|
})
|
||
|
.PrimaryKey(t => t.ID)
|
||
|
.ForeignKey("dbo.AspNetUsers", t => t.UserID, cascadeDelete: true)
|
||
|
.ForeignKey("dbo.DocExcelTemplates", t => t.TemplateID, cascadeDelete: true);
|
||
|
|
||
|
|
||
|
}
|
||
|
|
||
|
public override void Down()
|
||
|
{
|
||
|
DropForeignKey("dbo.UserLCADocExcelTemplates_AspNetUsers", "UserID", "dbo.AspNetUsers");
|
||
|
DropForeignKey("dbo.UserLCADocExcelTemplates_DocExcelTemplates", "TemplateID", "dbo.DocExcelTemplates");
|
||
|
DropTable("dbo.UserLCADocExcelTemplates");
|
||
|
DropTable("dbo.DocExcelTemplates");
|
||
|
}
|
||
|
}
|
||
|
}
|