using Microsoft.EntityFrameworkCore.Migrations; namespace DatamodelLibrary.Migrations { public partial class completion_person_address : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.AddColumn( name: "Comments", table: "Persons", type: "TEXT", nullable: true); migrationBuilder.AddColumn( name: "HomeAddress", table: "Persons", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.AddColumn( name: "InvoiceAddress", table: "Persons", type: "INTEGER", nullable: false, defaultValue: 0); migrationBuilder.CreateTable( name: "Addresses", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Gata = table.Column(type: "TEXT", nullable: true), Gata2 = table.Column(type: "TEXT", nullable: true), PostNr = table.Column(type: "INTEGER", nullable: false), PostOrt = table.Column(type: "TEXT", nullable: true), Nation = table.Column(type: "TEXT", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Addresses", x => x.Id); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Addresses"); migrationBuilder.DropColumn( name: "Comments", table: "Persons"); migrationBuilder.DropColumn( name: "HomeAddress", table: "Persons"); migrationBuilder.DropColumn( name: "InvoiceAddress", table: "Persons"); } } }