using System;
using Microsoft.EntityFrameworkCore.Migrations;
using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
#nullable disable
namespace DiscordApp.Migrations
{
///
public partial class Migrate11111701 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Certificate",
schema: "public",
columns: table => new
{
Id = table.Column(type: "integer", nullable: false)
.Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
Employee = table.Column(type: "text", nullable: false),
passportId = table.Column(type: "integer", nullable: false),
Date = table.Column(type: "date", nullable: false),
Text = table.Column(type: "text", nullable: false),
DocumentId = table.Column(type: "integer", nullable: false),
DocumentType = table.Column(type: "text", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Certificate", x => x.Id);
table.ForeignKey(
name: "FK_Certificate_Passport_passportId",
column: x => x.passportId,
principalSchema: "public",
principalTable: "Passport",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_Certificate_passportId",
schema: "public",
table: "Certificate",
column: "passportId");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Certificate",
schema: "public");
}
}
}