52 lines
1.8 KiB
C#
52 lines
1.8 KiB
C#
|
using System;
|
|||
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|||
|
|
|||
|
#nullable disable
|
|||
|
|
|||
|
namespace DatabaseImplement.Migrations
|
|||
|
{
|
|||
|
public partial class Init : Migration
|
|||
|
{
|
|||
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Manufacturers",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Manufacturers", x => x.Id);
|
|||
|
});
|
|||
|
|
|||
|
migrationBuilder.CreateTable(
|
|||
|
name: "Products",
|
|||
|
columns: table => new
|
|||
|
{
|
|||
|
Id = table.Column<int>(type: "int", nullable: false)
|
|||
|
.Annotation("SqlServer:Identity", "1, 1"),
|
|||
|
Name = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
Image = table.Column<byte[]>(type: "varbinary(max)", nullable: false),
|
|||
|
Manufacturers = table.Column<string>(type: "nvarchar(max)", nullable: false),
|
|||
|
DeliveryDate = table.Column<DateTime>(type: "datetime2", nullable: false)
|
|||
|
},
|
|||
|
constraints: table =>
|
|||
|
{
|
|||
|
table.PrimaryKey("PK_Products", x => x.Id);
|
|||
|
});
|
|||
|
}
|
|||
|
|
|||
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|||
|
{
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Manufacturers");
|
|||
|
|
|||
|
migrationBuilder.DropTable(
|
|||
|
name: "Products");
|
|||
|
}
|
|||
|
}
|
|||
|
}
|