Files
MileageTraker/Web/Migrations/201510070326593_VehicleService.cs
T

36 lines
1.4 KiB
C#

namespace MileageTraker.Web.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class VehicleService : DbMigration
{
public override void Up()
{
CreateTable(
"dbo.VehicleService",
c => new
{
VehicleServiceId = c.Int(nullable: false, identity: true),
InvoiceDate = c.DateTime(nullable: false),
ServiceCenterName = c.String(nullable: false, maxLength: 64),
InvoiceNumber = c.String(nullable: false, maxLength: 32),
Price = c.Decimal(nullable: false, precision: 18, scale: 2),
Description = c.String(maxLength: 64),
Vehicle_VehicleId = c.String(nullable: false, maxLength: 6),
})
.PrimaryKey(t => t.VehicleServiceId)
.ForeignKey("dbo.Vehicle", t => t.Vehicle_VehicleId, cascadeDelete: true)
.Index(t => t.Vehicle_VehicleId);
}
public override void Down()
{
DropForeignKey("dbo.VehicleService", "Vehicle_VehicleId", "dbo.Vehicle");
DropIndex("dbo.VehicleService", new[] { "Vehicle_VehicleId" });
DropTable("dbo.VehicleService");
}
}
}