103 lines
3.5 KiB
C#
103 lines
3.5 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace PowderCoating.Infrastructure.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class MakeAppointmentCustomerIdOptional : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Appointments_Customers_CustomerId",
|
|
table: "Appointments");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "CustomerId",
|
|
table: "Appointments",
|
|
type: "int",
|
|
nullable: true,
|
|
oldClrType: typeof(int),
|
|
oldType: "int");
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 15, 0, 5, 25, 692, DateTimeKind.Utc).AddTicks(5144));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 2,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 15, 0, 5, 25, 692, DateTimeKind.Utc).AddTicks(5153));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 3,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 15, 0, 5, 25, 692, DateTimeKind.Utc).AddTicks(5155));
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Appointments_Customers_CustomerId",
|
|
table: "Appointments",
|
|
column: "CustomerId",
|
|
principalTable: "Customers",
|
|
principalColumn: "Id");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropForeignKey(
|
|
name: "FK_Appointments_Customers_CustomerId",
|
|
table: "Appointments");
|
|
|
|
migrationBuilder.AlterColumn<int>(
|
|
name: "CustomerId",
|
|
table: "Appointments",
|
|
type: "int",
|
|
nullable: false,
|
|
defaultValue: 0,
|
|
oldClrType: typeof(int),
|
|
oldType: "int",
|
|
oldNullable: true);
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 1,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 14, 22, 13, 31, 263, DateTimeKind.Utc).AddTicks(3342));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 2,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 14, 22, 13, 31, 263, DateTimeKind.Utc).AddTicks(3348));
|
|
|
|
migrationBuilder.UpdateData(
|
|
table: "PricingTiers",
|
|
keyColumn: "Id",
|
|
keyValue: 3,
|
|
column: "CreatedAt",
|
|
value: new DateTime(2026, 2, 14, 22, 13, 31, 263, DateTimeKind.Utc).AddTicks(3349));
|
|
|
|
migrationBuilder.AddForeignKey(
|
|
name: "FK_Appointments_Customers_CustomerId",
|
|
table: "Appointments",
|
|
column: "CustomerId",
|
|
principalTable: "Customers",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Cascade);
|
|
}
|
|
}
|
|
}
|