using Microsoft.EntityFrameworkCore.Migrations; using System; using System.Collections.Generic; namespace Artemis.Storage.Migrations { public partial class InitialCreate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Profiles", columns: table => new { Id = table.Column(nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Profiles", x => x.Id); }); migrationBuilder.CreateTable( name: "Settings", columns: table => new { Name = table.Column(nullable: false), Value = table.Column(nullable: true) }, constraints: table => { table.PrimaryKey("PK_Settings", x => x.Name); }); migrationBuilder.CreateTable( name: "Layer", columns: table => new { ProfileId = table.Column(nullable: false), Name = table.Column(nullable: false) }, constraints: table => { table.PrimaryKey("PK_Layer", x => new { x.ProfileId, x.Name }); table.ForeignKey( name: "FK_Layer_Profiles_ProfileId", column: x => x.ProfileId, principalTable: "Profiles", principalColumn: "Id", onDelete: ReferentialAction.Cascade); }); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Layer"); migrationBuilder.DropTable( name: "Settings"); migrationBuilder.DropTable( name: "Profiles"); } } }