using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace Marco.Pms.DataAccess.Migrations { /// public partial class Made_UpdatedBy_And_UpdateAt_As_Nullable : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PaymentRequests_Employees_UpdatedById", table: "PaymentRequests"); migrationBuilder.DropForeignKey( name: "FK_RecurringPayments_Employees_UpdatedById", table: "RecurringPayments"); migrationBuilder.AlterColumn( name: "UpdatedById", table: "RecurringPayments", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "RecurringPayments", type: "datetime(6)", nullable: true, oldClrType: typeof(DateTime), oldType: "datetime(6)"); migrationBuilder.AlterColumn( name: "UpdatedById", table: "PaymentRequests", type: "char(36)", nullable: true, collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)") .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "PaymentRequests", type: "datetime(6)", nullable: true, oldClrType: typeof(DateTime), oldType: "datetime(6)"); migrationBuilder.AddForeignKey( name: "FK_PaymentRequests_Employees_UpdatedById", table: "PaymentRequests", column: "UpdatedById", principalTable: "Employees", principalColumn: "Id"); migrationBuilder.AddForeignKey( name: "FK_RecurringPayments_Employees_UpdatedById", table: "RecurringPayments", column: "UpdatedById", principalTable: "Employees", principalColumn: "Id"); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_PaymentRequests_Employees_UpdatedById", table: "PaymentRequests"); migrationBuilder.DropForeignKey( name: "FK_RecurringPayments_Employees_UpdatedById", table: "RecurringPayments"); migrationBuilder.AlterColumn( name: "UpdatedById", table: "RecurringPayments", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "RecurringPayments", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), oldClrType: typeof(DateTime), oldType: "datetime(6)", oldNullable: true); migrationBuilder.AlterColumn( name: "UpdatedById", table: "PaymentRequests", type: "char(36)", nullable: false, defaultValue: new Guid("00000000-0000-0000-0000-000000000000"), collation: "ascii_general_ci", oldClrType: typeof(Guid), oldType: "char(36)", oldNullable: true) .OldAnnotation("Relational:Collation", "ascii_general_ci"); migrationBuilder.AlterColumn( name: "UpdatedAt", table: "PaymentRequests", type: "datetime(6)", nullable: false, defaultValue: new DateTime(1, 1, 1, 0, 0, 0, 0, DateTimeKind.Unspecified), oldClrType: typeof(DateTime), oldType: "datetime(6)", oldNullable: true); migrationBuilder.AddForeignKey( name: "FK_PaymentRequests_Employees_UpdatedById", table: "PaymentRequests", column: "UpdatedById", principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_RecurringPayments_Employees_UpdatedById", table: "RecurringPayments", column: "UpdatedById", principalTable: "Employees", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }