using Microsoft.EntityFrameworkCore.Migrations; using System; #nullable disable namespace MP.Data.Migrations { public partial class InitialCreate : Migration { protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.CreateTable( name: "InveSess", columns: table => new { InveSessID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), Description = table.Column(type: "nvarchar(max)", nullable: true), UserCrea = table.Column(type: "nvarchar(max)", nullable: true), DtStart = table.Column(type: "datetime2", nullable: false), DtEnd = table.Column(type: "datetime2", nullable: true), Transferred = table.Column(type: "bit", nullable: false) }, constraints: table => { table.PrimaryKey("PK_InveSess", x => x.InveSessID); }); migrationBuilder.CreateTable( name: "InveScanData", columns: table => new { ScanID = table.Column(type: "int", nullable: false) .Annotation("SqlServer:Identity", "1, 1"), DtScan = table.Column(type: "datetime2", nullable: false), UserScan = table.Column(type: "nvarchar(max)", nullable: true), ScanValue = table.Column(type: "nvarchar(max)", nullable: true), IsForced = table.Column(type: "bit", nullable: false), CodArticolo = table.Column(type: "nvarchar(max)", nullable: true), Lotto = table.Column(type: "nvarchar(max)", nullable: true), RifExt = table.Column(type: "nvarchar(max)", nullable: true), Qty = table.Column(type: "decimal(18,6)", nullable: false), Note = table.Column(type: "nvarchar(max)", nullable: true), IsKnown = table.Column(type: "bit", nullable: false), IsUnique = table.Column(type: "bit", nullable: false), InveSessID = table.Column(type: "int", nullable: false) }, constraints: table => { table.PrimaryKey("PK_InveScanData", x => x.ScanID); table.ForeignKey( name: "FK_InveScanData_InveSess_InveSessID", column: x => x.InveSessID, principalTable: "InveSess", principalColumn: "InveSessID", onDelete: ReferentialAction.Cascade); }); migrationBuilder.CreateIndex( name: "IX_InveScanData_InveSessID", table: "InveScanData", column: "InveSessID"); } protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropTable( name: "InveScanData"); migrationBuilder.DropTable( name: "InveSess"); } } }