using System; using Microsoft.EntityFrameworkCore.Migrations; #nullable disable namespace DiunaBI.Infrastructure.Migrations { /// public partial class UpdateModel : Migration { /// protected override void Up(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Layers_Users_CreatedById", table: "Layers"); migrationBuilder.DropForeignKey( name: "FK_Layers_Users_ModifiedById", table: "Layers"); migrationBuilder.DropForeignKey( name: "FK_ProcessSources_Layers_SourceId", table: "ProcessSources"); migrationBuilder.DropForeignKey( name: "FK_Records_Users_CreatedById", table: "Records"); migrationBuilder.DropForeignKey( name: "FK_Records_Users_ModifiedById", table: "Records"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Users", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "ModifiedAt", table: "Records", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Records", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "QueueJobs", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "ModifiedAt", table: "Layers", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "IsDeleted", table: "Layers", type: "bit", nullable: false, defaultValue: false, oldClrType: typeof(bool), oldType: "bit"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Layers", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "DataInbox", type: "datetime2", nullable: false, defaultValueSql: "GETUTCDATE()", oldClrType: typeof(DateTime), oldType: "datetime2"); migrationBuilder.AddForeignKey( name: "FK_Layers_Users_CreatedById", table: "Layers", column: "CreatedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Layers_Users_ModifiedById", table: "Layers", column: "ModifiedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_ProcessSources_Layers_LayerId", table: "ProcessSources", column: "LayerId", principalTable: "Layers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ProcessSources_Layers_SourceId", table: "ProcessSources", column: "SourceId", principalTable: "Layers", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Records_Users_CreatedById", table: "Records", column: "CreatedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); migrationBuilder.AddForeignKey( name: "FK_Records_Users_ModifiedById", table: "Records", column: "ModifiedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Restrict); } /// protected override void Down(MigrationBuilder migrationBuilder) { migrationBuilder.DropForeignKey( name: "FK_Layers_Users_CreatedById", table: "Layers"); migrationBuilder.DropForeignKey( name: "FK_Layers_Users_ModifiedById", table: "Layers"); migrationBuilder.DropForeignKey( name: "FK_ProcessSources_Layers_LayerId", table: "ProcessSources"); migrationBuilder.DropForeignKey( name: "FK_ProcessSources_Layers_SourceId", table: "ProcessSources"); migrationBuilder.DropForeignKey( name: "FK_Records_Users_CreatedById", table: "Records"); migrationBuilder.DropForeignKey( name: "FK_Records_Users_ModifiedById", table: "Records"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Users", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "ModifiedAt", table: "Records", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Records", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "QueueJobs", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "ModifiedAt", table: "Layers", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "IsDeleted", table: "Layers", type: "bit", nullable: false, oldClrType: typeof(bool), oldType: "bit", oldDefaultValue: false); migrationBuilder.AlterColumn( name: "CreatedAt", table: "Layers", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AlterColumn( name: "CreatedAt", table: "DataInbox", type: "datetime2", nullable: false, oldClrType: typeof(DateTime), oldType: "datetime2", oldDefaultValueSql: "GETUTCDATE()"); migrationBuilder.AddForeignKey( name: "FK_Layers_Users_CreatedById", table: "Layers", column: "CreatedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Layers_Users_ModifiedById", table: "Layers", column: "ModifiedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_ProcessSources_Layers_SourceId", table: "ProcessSources", column: "SourceId", principalTable: "Layers", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Records_Users_CreatedById", table: "Records", column: "CreatedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); migrationBuilder.AddForeignKey( name: "FK_Records_Users_ModifiedById", table: "Records", column: "ModifiedById", principalTable: "Users", principalColumn: "Id", onDelete: ReferentialAction.Cascade); } } }