demo20230512/Migrations/202212290234282_MaterialAddColumnsAndRelation.cs
2023-05-12 10:20:28 +08:00

37 lines
2.4 KiB
C#

namespace Weee.Migrations
{
using System;
using System.Data.Entity.Migrations;
public partial class MaterialAddColumnsAndRelation : DbMigration
{
public override void Up()
{
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "Area", c => c.Decimal(nullable: false, precision: 24, scale: 12));
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "WeightUnit", c => c.String());
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "Volume", c => c.Decimal(nullable: false, precision: 24, scale: 12));
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "VolumeUnit", c => c.String());
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "Density", c => c.Decimal(precision: 24, scale: 12));
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "ActivityIntensity_BOM", c => c.Decimal(nullable: false, precision: 24, scale: 12));
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "KgCO2e_BOM", c => c.Decimal(nullable: false, precision: 24, scale: 12));
AddForeignKey("dbo.ProductLCASurveyForm_MaterialComposite", "materialID", "dbo.ProductLCAProductSurveyForm_Materials", "ID");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "MaterialTypeText");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "Weight_mg");
}
public override void Down()
{
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "Weight_mg", c => c.Decimal(nullable: false, precision: 24, scale: 12));
AddColumn("dbo.ProductLCAProductSurveyForm_Materials", "MaterialTypeText", c => c.String());
DropForeignKey("dbo.ProductLCASurveyForm_MaterialComposite", "materialID", "dbo.ProductLCAProductSurveyForm_Materials");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "KgCO2e_BOM");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "ActivityIntensity_BOM");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "Density");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "VolumeUnit");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "Volume");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "WeightUnit");
DropColumn("dbo.ProductLCAProductSurveyForm_Materials", "Area");
}
}
}