using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace NetinaShop.Repository.Migrations
{
///
public partial class AddSubProduct : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "Discriminator",
schema: "public",
table: "Products",
type: "character varying(13)",
maxLength: 13,
nullable: false,
defaultValue: "Product");
migrationBuilder.AddColumn(
name: "Diversity",
schema: "public",
table: "Products",
type: "integer",
nullable: true);
migrationBuilder.AddColumn(
name: "DiversityDescription",
schema: "public",
table: "Products",
type: "text",
nullable: true);
migrationBuilder.AddColumn(
name: "DiversityValue",
schema: "public",
table: "Products",
type: "text",
nullable: true);
migrationBuilder.AddColumn(
name: "IsSubProduct",
schema: "public",
table: "Products",
type: "boolean",
nullable: false,
defaultValue: true);
migrationBuilder.AddColumn(
name: "ParentId",
schema: "public",
table: "Products",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Products_ParentId",
schema: "public",
table: "Products",
column: "ParentId");
migrationBuilder.AddForeignKey(
name: "FK_Products_Products_ParentId",
schema: "public",
table: "Products",
column: "ParentId",
principalSchema: "public",
principalTable: "Products",
principalColumn: "Id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Products_Products_ParentId",
schema: "public",
table: "Products");
migrationBuilder.DropIndex(
name: "IX_Products_ParentId",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "Discriminator",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "Diversity",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "DiversityDescription",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "DiversityValue",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "IsSubProduct",
schema: "public",
table: "Products");
migrationBuilder.DropColumn(
name: "ParentId",
schema: "public",
table: "Products");
}
}
}