Files
Backend-Api/CompanyManagment.EFCore/Migrations/20231118144633_FileAndFileEmployer.cs
2024-07-05 21:36:15 +03:30

46 lines
1.8 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
namespace CompanyManagment.EFCore.Migrations
{
public partial class FileAndFileEmployer : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "FileAndFileEmployers",
columns: table => new
{
FileId = table.Column<long>(type: "bigint", nullable: false),
FileEmployerId = table.Column<long>(type: "bigint", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_FileAndFileEmployers", x => new { x.FileId, x.FileEmployerId });
table.ForeignKey(
name: "FK_FileAndFileEmployers_FileEmployer_FileEmployerId",
column: x => x.FileEmployerId,
principalTable: "FileEmployer",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_FileAndFileEmployers_Files_FileId",
column: x => x.FileId,
principalTable: "Files",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_FileAndFileEmployers_FileEmployerId",
table: "FileAndFileEmployers",
column: "FileEmployerId");
}
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "FileAndFileEmployers");
}
}
}