namespace Sevomin.Models.Migrations
|
|
{
|
|
using System;
|
|
using System.Data.Entity.Migrations;
|
|
|
|
public partial class Avalin_Dovomin_New_Tables : DbMigration
|
|
{
|
|
public override void Up()
|
|
{
|
|
CreateTable(
|
|
"dbo.Avalin",
|
|
c => new
|
|
{
|
|
Id = c.String(nullable: false, maxLength: 128),
|
|
CompanyName = c.String(),
|
|
})
|
|
.PrimaryKey(t => t.Id)
|
|
.ForeignKey("dbo.AspNetUsers", t => t.Id)
|
|
.Index(t => t.Id);
|
|
|
|
CreateTable(
|
|
"dbo.Dovomin",
|
|
c => new
|
|
{
|
|
Id = c.String(nullable: false, maxLength: 128),
|
|
FirstName = c.String(),
|
|
LastName = c.String(),
|
|
})
|
|
.PrimaryKey(t => t.Id)
|
|
.ForeignKey("dbo.AspNetUsers", t => t.Id)
|
|
.Index(t => t.Id);
|
|
|
|
DropColumn("dbo.AspNetUsers", "CompanyName");
|
|
DropColumn("dbo.AspNetUsers", "FirstName");
|
|
DropColumn("dbo.AspNetUsers", "LastName");
|
|
DropColumn("dbo.AspNetUsers", "Discriminator");
|
|
}
|
|
|
|
public override void Down()
|
|
{
|
|
AddColumn("dbo.AspNetUsers", "Discriminator", c => c.String(nullable: false, maxLength: 128));
|
|
AddColumn("dbo.AspNetUsers", "LastName", c => c.String());
|
|
AddColumn("dbo.AspNetUsers", "FirstName", c => c.String());
|
|
AddColumn("dbo.AspNetUsers", "CompanyName", c => c.String());
|
|
DropForeignKey("dbo.Dovomin", "Id", "dbo.AspNetUsers");
|
|
DropForeignKey("dbo.Avalin", "Id", "dbo.AspNetUsers");
|
|
DropIndex("dbo.Dovomin", new[] { "Id" });
|
|
DropIndex("dbo.Avalin", new[] { "Id" });
|
|
DropTable("dbo.Dovomin");
|
|
DropTable("dbo.Avalin");
|
|
}
|
|
}
|
|
}
|