namespace Sevomin.Models.Migrations
|
|
{
|
|
using System;
|
|
using System.Data.Entity.Migrations;
|
|
|
|
public partial class Paramvalues : DbMigration
|
|
{
|
|
public override void Up()
|
|
{
|
|
CreateTable(
|
|
"dbo.Parameters",
|
|
c => new
|
|
{
|
|
Id = c.Int(nullable: false, identity: true),
|
|
Name = c.String(nullable: false),
|
|
Moscow = c.Boolean(nullable: false),
|
|
DisplayMethod = c.Byte(nullable: false),
|
|
GroupName = c.String(nullable: false),
|
|
CommentAvalin = c.String(maxLength: 140),
|
|
CommentDovomin = c.String(maxLength: 140),
|
|
ParameterValueId = c.String(maxLength: 50),
|
|
})
|
|
.PrimaryKey(t => t.Id)
|
|
.Index(t=>t.ParameterValueId);
|
|
|
|
CreateTable(
|
|
"dbo.ParameterValues",
|
|
c => new
|
|
{
|
|
GroupKey = c.String(nullable: false, maxLength: 50),
|
|
Value = c.String(nullable: false, maxLength: 50),
|
|
})
|
|
.PrimaryKey(t => new { t.GroupKey, t.Value })
|
|
.Index(t => t.GroupKey);
|
|
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
DropForeignKey("dbo.ParameterValues", "Parameter_Id", "dbo.Parameters");
|
|
DropIndex("dbo.ParameterValues", new[] { "Parameter_Id" });
|
|
DropIndex("dbo.ParameterValues", new[] { "GroupKey" });
|
|
DropTable("dbo.ParameterValues");
|
|
DropTable("dbo.Parameters");
|
|
}
|
|
}
|
|
}
|