175 lines
13 KiB
C#
175 lines
13 KiB
C#
|
namespace Weee.Migrations
|
|||
|
{
|
|||
|
using System;
|
|||
|
using System.Data.Entity.Migrations;
|
|||
|
|
|||
|
public partial class addProductDataQualityRelated : DbMigration
|
|||
|
{
|
|||
|
public override void Up()
|
|||
|
{
|
|||
|
CreateTable(
|
|||
|
"dbo.ProductDataQualityLevels",
|
|||
|
c => new
|
|||
|
{
|
|||
|
ID = c.Int(nullable: false, identity: true),
|
|||
|
LCAID = c.Int(nullable: false),
|
|||
|
name = c.String(),
|
|||
|
tablename = c.String(unicode: false, maxLength: 50, nullable: false, defaultValue: ""),
|
|||
|
tableId = c.Int(nullable: false),
|
|||
|
DQRaiRe = c.Int(),
|
|||
|
DQRaiReComments = c.String(),
|
|||
|
DQRaiCo = c.Int(),
|
|||
|
DQRaiCoComments = c.String(),
|
|||
|
DQRaiTi = c.Int(),
|
|||
|
DQRaiTiComments = c.String(),
|
|||
|
DQRaiGe = c.Int(),
|
|||
|
DQRaiGeComments = c.String(),
|
|||
|
DQRaiTe = c.Int(),
|
|||
|
DQRaiTeComments = c.String(),
|
|||
|
DQReiRe = c.Int(),
|
|||
|
DQReiReComments = c.String(),
|
|||
|
DQReiCo = c.Int(),
|
|||
|
DQReiCoComments = c.String(),
|
|||
|
DQReiTi = c.Int(),
|
|||
|
DQReiTiComments = c.String(),
|
|||
|
DQReiGe = c.Int(),
|
|||
|
DQReiGeComments = c.String(),
|
|||
|
DQReiTe = c.Int(),
|
|||
|
DQReiTeComments = c.String(),
|
|||
|
DQRniRe = c.Int(),
|
|||
|
DQRniCo = c.Int(),
|
|||
|
DQRniTi = c.Int(),
|
|||
|
DQRniGe = c.Int(),
|
|||
|
DQRniTe = c.Int(),
|
|||
|
DQRiRe = c.Int(),
|
|||
|
DQRiCo = c.Int(),
|
|||
|
DQRiTi = c.Int(),
|
|||
|
DQRiGe = c.Int(),
|
|||
|
DQRiTe = c.Int(),
|
|||
|
DQR = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
Fi = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
DQRw = c.Decimal(nullable: false, precision: 24, scale: 12),
|
|||
|
})
|
|||
|
.PrimaryKey(t => t.ID)
|
|||
|
.ForeignKey("dbo.LCAs", t => t.LCAID, cascadeDelete: false)
|
|||
|
.Index(t => t.LCAID);
|
|||
|
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_FireEquipments", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_GasolineEquipments", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_Kitchens", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_PowerUsages", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_Refrigerants", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_SteamUsages", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_Vehicles", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.LCACommonSurveyForm_WorkHours", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAAbandonedStage", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAFabSurveyForm_OtherCompounds", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAFabSurveyForm_Transports", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAFabSurveyForm_Wastes", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAFabSurveyForm_WasteTransports", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductLCAFabSurveyForm_WaterUsages", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductInventoryParameterData", "DataQualityID", c => c.Int());
|
|||
|
AddColumn("dbo.ProductInventoryStageData", "DataQualityID", c => c.Int());
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_FireEquipments", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_GasolineEquipments", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_Kitchens", "DataQualityID");
|
|||
|
CreateIndex("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_PowerUsages", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_Refrigerants", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_SteamUsages", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_Vehicles", "DataQualityID");
|
|||
|
CreateIndex("dbo.LCACommonSurveyForm_WorkHours", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAAbandonedStage", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAProductSurveyForm_Materials", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAFabSurveyForm_OtherCompounds", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAFabSurveyForm_Transports", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAFabSurveyForm_Wastes", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAFabSurveyForm_WasteTransports", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductLCAFabSurveyForm_WaterUsages", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductInventoryParameterData", "DataQualityID");
|
|||
|
CreateIndex("dbo.ProductInventoryStageData", "DataQualityID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_FireEquipments", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_GasolineEquipments", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_Kitchens", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_PowerUsages", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_Refrigerants", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_SteamUsages", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_Vehicles", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.LCACommonSurveyForm_WorkHours", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAAbandonedStage", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAProductSurveyForm_Materials", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAFabSurveyForm_OtherCompounds", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAFabSurveyForm_Transports", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAFabSurveyForm_Wastes", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAFabSurveyForm_WasteTransports", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductLCAFabSurveyForm_WaterUsages", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductInventoryParameterData", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
AddForeignKey("dbo.ProductInventoryStageData", "DataQualityID", "dbo.ProductDataQualityLevels", "ID");
|
|||
|
}
|
|||
|
|
|||
|
public override void Down()
|
|||
|
{
|
|||
|
DropForeignKey("dbo.ProductInventoryStageData", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductInventoryParameterData", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAFabSurveyForm_WaterUsages", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAFabSurveyForm_WasteTransports", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAFabSurveyForm_Wastes", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAFabSurveyForm_Transports", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAFabSurveyForm_OtherCompounds", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAProductSurveyForm_Materials", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductLCAAbandonedStage", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_WorkHours", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_Vehicles", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_SteamUsages", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_Refrigerants", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_PowerUsages", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_Kitchens", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_GasolineEquipments", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.LCACommonSurveyForm_FireEquipments", "DataQualityID", "dbo.ProductDataQualityLevels");
|
|||
|
DropForeignKey("dbo.ProductDataQualityLevels", "LCAID", "dbo.LCAs");
|
|||
|
DropIndex("dbo.ProductInventoryStageData", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductInventoryParameterData", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAFabSurveyForm_WaterUsages", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAFabSurveyForm_WasteTransports", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAFabSurveyForm_Wastes", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAFabSurveyForm_Transports", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAFabSurveyForm_OtherCompounds", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAProductSurveyForm_Materials", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductLCAAbandonedStage", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_WorkHours", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_Vehicles", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_SteamUsages", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_Refrigerants", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_PowerUsages", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_Kitchens", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_GasolineEquipments", new[] { "DataQualityID" });
|
|||
|
DropIndex("dbo.ProductDataQualityLevels", new[] { "LCAID" });
|
|||
|
DropIndex("dbo.LCACommonSurveyForm_FireEquipments", new[] { "DataQualityID" });
|
|||
|
DropColumn("dbo.ProductInventoryStageData", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductInventoryParameterData", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAFabSurveyForm_WaterUsages", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAFabSurveyForm_WasteTransports", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAFabSurveyForm_Wastes", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAFabSurveyForm_Transports", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAFabSurveyForm_OtherCompounds", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "DataQualityID");
|
|||
|
DropColumn("dbo.ProductLCAAbandonedStage", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_WorkHours", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_Vehicles", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_SteamUsages", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_Refrigerants", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_PowerUsages", "DataQualityID");
|
|||
|
DropColumn("dbo.OrganizationLCAFabSurveyForm_OtherCompounds", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_Kitchens", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_GasolineEquipments", "DataQualityID");
|
|||
|
DropColumn("dbo.LCACommonSurveyForm_FireEquipments", "DataQualityID");
|
|||
|
DropTable("dbo.ProductDataQualityLevels");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|