COP-17/WinFormsProject/DateBaseImplement/Migrations/20231115184705_initMigration.cs

55 lines
2.0 KiB
C#
Raw Permalink Normal View History

2023-11-15 22:51:44 +04:00
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DateBaseImplement.Migrations
{
/// <inheritdoc />
public partial class initMigration : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Providers",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false),
Logo = table.Column<byte[]>(type: "bytea", nullable: false),
Type = table.Column<string>(type: "text", nullable: false),
Number = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Providers", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Types",
columns: table => new
{
Id = table.Column<int>(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Name = table.Column<string>(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Types", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Providers");
migrationBuilder.DropTable(
name: "Types");
}
}
}