using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NetinaShop.Repository.Migrations
{
///
public partial class EditDisc : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "BrandId",
schema: "public",
table: "OrderProducts",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"));
migrationBuilder.AddColumn(
name: "BrandId",
schema: "public",
table: "Discounts",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Discounts_BrandId",
schema: "public",
table: "Discounts",
column: "BrandId");
migrationBuilder.AddForeignKey(
name: "FK_Discounts_Brands_BrandId",
schema: "public",
table: "Discounts",
column: "BrandId",
principalSchema: "public",
principalTable: "Brands",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Discounts_Brands_BrandId",
schema: "public",
table: "Discounts");
migrationBuilder.DropIndex(
name: "IX_Discounts_BrandId",
schema: "public",
table: "Discounts");
migrationBuilder.DropColumn(
name: "BrandId",
schema: "public",
table: "OrderProducts");
migrationBuilder.DropColumn(
name: "BrandId",
schema: "public",
table: "Discounts");
}
}
}