Files
CMS/src/CMSMicroservice.Infrastructure/Persistence/Migrations/20251013044349_u04.cs
2025-10-13 08:19:47 +03:30

110 lines
3.3 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace CMSMicroservice.Infrastructure.Persistence.Migrations
{
/// <inheritdoc />
public partial class u04 : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<DateTime>(
name: "BirthDate",
schema: "CMS",
table: "Users",
type: "datetime2",
nullable: true);
migrationBuilder.AddColumn<bool>(
name: "EmailNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "PushNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<bool>(
name: "SmsNotifications",
schema: "CMS",
table: "Users",
type: "bit",
nullable: false,
defaultValue: false);
migrationBuilder.AddColumn<long>(
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);
}
/// <inheritdoc />
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");
}
}
}