57 lines
1.7 KiB
C#
57 lines
1.7 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace NetinaShop.Repository.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class EditUserAddress : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_UserAddresses_Customers_CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses");
|
|
|
|
migrationBuilder.DropIndex(
|
|
name: "IX_UserAddresses_CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses");
|
|
|
|
migrationBuilder.DropColumn(
|
|
name: "CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.AddColumn<Guid>(
|
|
name: "CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses",
|
|
type: "uuid",
|
|
nullable: true);
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_UserAddresses_CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses",
|
|
column: "CustomerId");
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_UserAddresses_Customers_CustomerId",
|
|
schema: "public",
|
|
table: "UserAddresses",
|
|
column: "CustomerId",
|
|
principalSchema: "public",
|
|
principalTable: "Customers",
|
|
principalColumn: "Id");
|
|
}
|
|
}
|
|
}
|