using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DrinkRateAPI.Migrations
{
///
public partial class ProductCompanyTableBinding : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "CompanyTableId",
table: "ProductTable",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AddColumn(
name: "ProductTableId",
table: "CompanyTables",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.CreateIndex(
name: "IX_ProductTable_CompanyTableId",
table: "ProductTable",
column: "CompanyTableId",
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_ProductTable_CompanyTables_CompanyTableId",
table: "ProductTable",
column: "CompanyTableId",
principalTable: "CompanyTables",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_ProductTable_CompanyTables_CompanyTableId",
table: "ProductTable");
migrationBuilder.DropIndex(
name: "IX_ProductTable_CompanyTableId",
table: "ProductTable");
migrationBuilder.DropColumn(
name: "CompanyTableId",
table: "ProductTable");
migrationBuilder.DropColumn(
name: "ProductTableId",
table: "CompanyTables");
}
}
}