using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
{
///
public partial class u04 : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "BirthDate",
schema: "CMS",
table: "Users",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn(
name: "EmailNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "PushNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "SmsNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn(
name: "UserAddressId",
schema: "CMS",
table: "UserOrders",
type: "bigint",
nullable: false,
defaultValue: 0L);
migrationBuilder.CreateIndex(
name: "IX_UserOrders_UserAddressId",
schema: "CMS",
table: "UserOrders",
column: "UserAddressId");
migrationBuilder.AddForeignKey(
name: "FK_UserOrders_UserAddresss_UserAddressId",
schema: "CMS",
table: "UserOrders",
column: "UserAddressId",
principalSchema: "CMS",
principalTable: "UserAddresss",
principalColumn: "Id",
onDelete: ReferentialAction.Restrict);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_UserOrders_UserAddresss_UserAddressId",
schema: "CMS",
table: "UserOrders");
migrationBuilder.DropIndex(
name: "IX_UserOrders_UserAddressId",
schema: "CMS",
table: "UserOrders");
migrationBuilder.DropColumn(
name: "BirthDate",
schema: "CMS",
table: "Users");
migrationBuilder.DropColumn(
name: "EmailNotifications",
schema: "CMS",
table: "Users");
migrationBuilder.DropColumn(
name: "PushNotifications",
schema: "CMS",
table: "Users");
migrationBuilder.DropColumn(
name: "SmsNotifications",
schema: "CMS",
table: "Users");
migrationBuilder.DropColumn(
name: "UserAddressId",
schema: "CMS",
table: "UserOrders");
}
}
}