74 lines
3.3 KiB
C#
74 lines
3.3 KiB
C#
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<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
Description = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
UserCrea = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
DtStart = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
DtEnd = table.Column<DateTime>(type: "datetime2", nullable: true),
|
|
Transferred = table.Column<bool>(type: "bit", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_InveSess", x => x.InveSessID);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "InveScanData",
|
|
columns: table => new
|
|
{
|
|
ScanID = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
DtScan = table.Column<DateTime>(type: "datetime2", nullable: false),
|
|
UserScan = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
ScanValue = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
IsForced = table.Column<bool>(type: "bit", nullable: false),
|
|
CodArticolo = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Lotto = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
RifExt = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
Qty = table.Column<decimal>(type: "decimal(18,6)", nullable: false),
|
|
Note = table.Column<string>(type: "nvarchar(max)", nullable: true),
|
|
IsKnown = table.Column<bool>(type: "bit", nullable: false),
|
|
IsUnique = table.Column<bool>(type: "bit", nullable: false),
|
|
InveSessID = table.Column<int>(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");
|
|
}
|
|
}
|
|
} |