Add vehicle recall

This commit is contained in:
2020-09-20 22:07:13 -04:00
parent b5589103ec
commit 6f031c5cb6
34 changed files with 890 additions and 45 deletions
@@ -0,0 +1,37 @@
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");
}
}
}