43 lines
1.8 KiB
C#
43 lines
1.8 KiB
C#
|
namespace Weee.Migrations
|
|||
|
{
|
|||
|
using System;
|
|||
|
using System.Data.Entity.Migrations;
|
|||
|
|
|||
|
public partial class addTableEmployeeCommuting : DbMigration
|
|||
|
{
|
|||
|
public override void Up()
|
|||
|
{
|
|||
|
CreateTable(
|
|||
|
"dbo.LCARiskAssmtSurveyForm_EmployeeCommuting",
|
|||
|
c => new
|
|||
|
{
|
|||
|
Id = c.Int(nullable: false, identity: true),
|
|||
|
Guid = c.Guid(nullable: false, defaultValueSql:"newid()"),
|
|||
|
LCAID = c.Int(nullable: false),
|
|||
|
Commuting = c.Int(nullable: false),
|
|||
|
TotalEmployees = c.Int(nullable: false),
|
|||
|
WorkingDays = c.Int(nullable: false),
|
|||
|
AverageMovingDistance = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
PersonDayKm = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
KgCO2e = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
Comment = c.String(),
|
|||
|
CreatedBy = c.String(),
|
|||
|
CreatedDate = c.DateTime(nullable:false, defaultValueSql:"getdate()"),
|
|||
|
ModifiedBy = c.String(),
|
|||
|
ModifiedDate = c.DateTime(nullable: false, defaultValueSql: "getdate()"),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.Id)
|
|||
|
.ForeignKey("dbo.LCAs", t => t.LCAID, cascadeDelete: true)
|
|||
|
.Index(t => t.LCAID);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
public override void Down()
|
|||
|
{
|
|||
|
DropForeignKey("dbo.LCARiskAssmtSurveyForm_EmployeeCommuting", "LCAID", "dbo.LCAs");
|
|||
|
DropIndex("dbo.LCARiskAssmtSurveyForm_EmployeeCommuting", new[] { "LCAID" });
|
|||
|
DropTable("dbo.LCARiskAssmtSurveyForm_EmployeeCommuting");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|