using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace CartriX.Api.Migrations { /// public partial class Init1 : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "Locations", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), Name = table.Column(type: "TEXT", nullable: false) }, constraints: table => { table.PrimaryKey("PK_Locations", x => x.Id); }); migrationBuilder.CreateTable( name: "Printers", columns: table => new { Id = table.Column(type: "INTEGER", nullable: false) .Annotation("Sqlite:Autoincrement", true), PrinterName = table.Column(type: "TEXT", nullable: false), LocationId = table.Column(type: "INTEGER", nullable: true) }, constraints: table => { table.PrimaryKey("PK_Printers", x => x.Id); table.ForeignKey( name: "FK_Printers_Locations_LocationId", column: x => x.LocationId, principalTable: "Locations", principalColumn: "Id"); }); migrationBuilder.CreateIndex( name: "IX_Printers_LocationId", table: "Printers", column: "LocationId"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "Printers"); migrationBuilder.DropTable( name: "Locations"); } } }