after refactor cleanup

This commit is contained in:
2025-11-28 11:21:22 +01:00
parent 5db6de1503
commit 07423023a0
305 changed files with 80 additions and 13326 deletions

View File

@@ -0,0 +1,47 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DiunaBI.Infrastructure.Migrations
{
/// <inheritdoc />
public partial class FixLayerDefaultValues : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
// Ensure IsDeleted has default constraint (in case previous migration didn't apply it correctly)
migrationBuilder.Sql(@"
IF NOT EXISTS (SELECT 1 FROM sys.default_constraints
WHERE parent_object_id = OBJECT_ID('Layers')
AND COL_NAME(parent_object_id, parent_column_id) = 'IsDeleted')
BEGIN
ALTER TABLE [Layers] ADD CONSTRAINT [DF_Layers_IsDeleted] DEFAULT 0 FOR [IsDeleted];
END
");
// Add default constraint for IsCancelled
migrationBuilder.AlterColumn<bool>(
name: "IsCancelled",
table: "Layers",
type: "bit",
nullable: false,
defaultValue: false,
oldClrType: typeof(bool),
oldType: "bit");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.AlterColumn<bool>(
name: "IsCancelled",
table: "Layers",
type: "bit",
nullable: false,
oldClrType: typeof(bool),
oldType: "bit",
oldDefaultValue: false);
}
}
}