88 lines
3.2 KiB
C#
88 lines
3.2 KiB
C#
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace Back.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class warehousenew1 : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Receipts",
|
|
columns: table => new
|
|
{
|
|
ID = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
CODID = table.Column<int>(type: "int", nullable: false),
|
|
Count = table.Column<int>(type: "int", nullable: false),
|
|
Date = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
ForSale = table.Column<bool>(type: "bit", nullable: false),
|
|
Type = table.Column<int>(type: "int", nullable: false),
|
|
info = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Receipts", x => x.ID);
|
|
table.ForeignKey(
|
|
name: "FK_Receipts_CODItems_CODID",
|
|
column: x => x.CODID,
|
|
principalTable: "CODItems",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateTable(
|
|
name: "Remittances",
|
|
columns: table => new
|
|
{
|
|
ID = table.Column<int>(type: "int", nullable: false)
|
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|
CODID = table.Column<int>(type: "int", nullable: false),
|
|
Count = table.Column<int>(type: "int", nullable: false),
|
|
Date = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|
Type = table.Column<int>(type: "int", nullable: false),
|
|
info = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Remittances", x => x.ID);
|
|
table.ForeignKey(
|
|
name: "FK_Remittances_CODItems_CODID",
|
|
column: x => x.CODID,
|
|
principalTable: "CODItems",
|
|
principalColumn: "ID",
|
|
onDelete: ReferentialAction.Cascade);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Receipts_CODID",
|
|
table: "Receipts",
|
|
column: "CODID");
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Remittances_CODID",
|
|
table: "Remittances",
|
|
column: "CODID");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
|
|
|
|
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Receipts");
|
|
|
|
migrationBuilder.DropTable(
|
|
name: "Remittances");
|
|
|
|
|
|
}
|
|
}
|
|
}
|