38 lines
1.5 KiB
C#
38 lines
1.5 KiB
C#
namespace MileageTraker.Web.Migrations
|
|
{
|
|
using System;
|
|
using System.Data.Entity.Migrations;
|
|
|
|
public partial class VehicleRecall : DbMigration
|
|
{
|
|
public override void Up()
|
|
{
|
|
CreateTable(
|
|
"dbo.VehicleRecall",
|
|
c => new
|
|
{
|
|
VehicleRecallId = c.Int(nullable: false, identity: true),
|
|
Identifier = c.String(nullable: false, maxLength: 128),
|
|
Description = c.String(nullable: false, maxLength: 128),
|
|
CompletedService_VehicleServiceId = c.Int(),
|
|
Vehicle_VehicleId = c.String(nullable: false, maxLength: 6),
|
|
})
|
|
.PrimaryKey(t => t.VehicleRecallId)
|
|
.ForeignKey("dbo.VehicleService", t => t.CompletedService_VehicleServiceId)
|
|
.ForeignKey("dbo.Vehicle", t => t.Vehicle_VehicleId, cascadeDelete: true)
|
|
.Index(t => t.CompletedService_VehicleServiceId)
|
|
.Index(t => t.Vehicle_VehicleId);
|
|
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
DropForeignKey("dbo.VehicleRecall", "Vehicle_VehicleId", "dbo.Vehicle");
|
|
DropForeignKey("dbo.VehicleRecall", "CompletedService_VehicleServiceId", "dbo.VehicleService");
|
|
DropIndex("dbo.VehicleRecall", new[] { "Vehicle_VehicleId" });
|
|
DropIndex("dbo.VehicleRecall", new[] { "CompletedService_VehicleServiceId" });
|
|
DropTable("dbo.VehicleRecall");
|
|
}
|
|
}
|
|
}
|