blazor.web.js issues
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
@@ -11,34 +11,9 @@ namespace EntKube.Web.Data.Migrations.Postgres
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_KeycloakRealms_KeycloakConnections_KeycloakConnectionId",
|
||||
table: "KeycloakRealms");
|
||||
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_VaultSecrets_KeycloakConnections_KeycloakConnectionId",
|
||||
table: "VaultSecrets");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "KeycloakConnections");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_VaultSecrets_KeycloakConnectionId",
|
||||
table: "VaultSecrets");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "KeycloakConnectionId",
|
||||
table: "VaultSecrets");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "KeycloakConnectionId",
|
||||
table: "KeycloakRealms",
|
||||
newName: "KeycloakComponentConfigId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_KeycloakRealms_KeycloakConnectionId_RealmName",
|
||||
table: "KeycloakRealms",
|
||||
newName: "IX_KeycloakRealms_KeycloakComponentConfigId_RealmName");
|
||||
// The migration that originally created KeycloakConnections and KeycloakRealms
|
||||
// was removed from history. This migration now creates both tables from scratch
|
||||
// using the final schema (post-rename), so fresh databases work correctly.
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "KeycloakComponentConfigs",
|
||||
@@ -75,6 +50,38 @@ namespace EntKube.Web.Data.Migrations.Postgres
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "KeycloakRealms",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
AccountTheme = table.Column<string>(type: "text", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
DisplayName = table.Column<string>(type: "character varying(200)", maxLength: 200, nullable: false),
|
||||
Enabled = table.Column<bool>(type: "boolean", nullable: false),
|
||||
KeycloakComponentConfigId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LinkedAppId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
LoginTheme = table.Column<string>(type: "text", nullable: true),
|
||||
RealmName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_KeycloakRealms", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakRealms_Apps_LinkedAppId",
|
||||
column: x => x.LinkedAppId,
|
||||
principalTable: "Apps",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakRealms_KeycloakComponentConfigs_KeycloakComponentCo~",
|
||||
column: x => x.KeycloakComponentConfigId,
|
||||
principalTable: "KeycloakComponentConfigs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakComponentConfigs_ClusterComponentId",
|
||||
table: "KeycloakComponentConfigs",
|
||||
@@ -90,111 +97,23 @@ namespace EntKube.Web.Data.Migrations.Postgres
|
||||
table: "KeycloakComponentConfigs",
|
||||
column: "TenantId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_KeycloakRealms_KeycloakComponentConfigs_KeycloakComponentCo~",
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakRealms_LinkedAppId",
|
||||
table: "KeycloakRealms",
|
||||
column: "KeycloakComponentConfigId",
|
||||
principalTable: "KeycloakComponentConfigs",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
column: "LinkedAppId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakRealms_KeycloakComponentConfigId_RealmName",
|
||||
table: "KeycloakRealms",
|
||||
columns: new[] { "KeycloakComponentConfigId", "RealmName" },
|
||||
unique: true);
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_KeycloakRealms_KeycloakComponentConfigs_KeycloakComponentCo~",
|
||||
table: "KeycloakRealms");
|
||||
|
||||
migrationBuilder.DropTable(
|
||||
name: "KeycloakComponentConfigs");
|
||||
|
||||
migrationBuilder.RenameColumn(
|
||||
name: "KeycloakComponentConfigId",
|
||||
table: "KeycloakRealms",
|
||||
newName: "KeycloakConnectionId");
|
||||
|
||||
migrationBuilder.RenameIndex(
|
||||
name: "IX_KeycloakRealms_KeycloakComponentConfigId_RealmName",
|
||||
table: "KeycloakRealms",
|
||||
newName: "IX_KeycloakRealms_KeycloakConnectionId_RealmName");
|
||||
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "KeycloakConnectionId",
|
||||
table: "VaultSecrets",
|
||||
type: "uuid",
|
||||
nullable: true);
|
||||
|
||||
migrationBuilder.CreateTable(
|
||||
name: "KeycloakConnections",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
AdminPasswordSecretId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
KubernetesClusterId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
TenantId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
AdminUrl = table.Column<string>(type: "character varying(500)", maxLength: 500, nullable: false),
|
||||
AdminUsername = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_KeycloakConnections", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakConnections_KubernetesClusters_KubernetesClusterId",
|
||||
column: x => x.KubernetesClusterId,
|
||||
principalTable: "KubernetesClusters",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakConnections_Tenants_TenantId",
|
||||
column: x => x.TenantId,
|
||||
principalTable: "Tenants",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakConnections_VaultSecrets_AdminPasswordSecretId",
|
||||
column: x => x.AdminPasswordSecretId,
|
||||
principalTable: "VaultSecrets",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_VaultSecrets_KeycloakConnectionId",
|
||||
table: "VaultSecrets",
|
||||
column: "KeycloakConnectionId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakConnections_AdminPasswordSecretId",
|
||||
table: "KeycloakConnections",
|
||||
column: "AdminPasswordSecretId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakConnections_KubernetesClusterId",
|
||||
table: "KeycloakConnections",
|
||||
column: "KubernetesClusterId");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakConnections_TenantId",
|
||||
table: "KeycloakConnections",
|
||||
column: "TenantId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_KeycloakRealms_KeycloakConnections_KeycloakConnectionId",
|
||||
table: "KeycloakRealms",
|
||||
column: "KeycloakConnectionId",
|
||||
principalTable: "KeycloakConnections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_VaultSecrets_KeycloakConnections_KeycloakConnectionId",
|
||||
table: "VaultSecrets",
|
||||
column: "KeycloakConnectionId",
|
||||
principalTable: "KeycloakConnections",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
migrationBuilder.DropTable(name: "KeycloakRealms");
|
||||
migrationBuilder.DropTable(name: "KeycloakComponentConfigs");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
using System;
|
||||
using System;
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
@@ -11,51 +11,56 @@ namespace EntKube.Web.Data.Migrations.Postgres
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_KeycloakBackups_StorageLinks_StorageLinkId",
|
||||
table: "KeycloakBackups");
|
||||
// The migration that originally created KeycloakBackups was removed from history.
|
||||
// This migration now creates the table directly with the final schema (nullable StorageLinkId).
|
||||
migrationBuilder.CreateTable(
|
||||
name: "KeycloakBackups",
|
||||
columns: table => new
|
||||
{
|
||||
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
CompletedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: true),
|
||||
CreatedAt = table.Column<DateTime>(type: "timestamp with time zone", nullable: false),
|
||||
KeycloakRealmId = table.Column<Guid>(type: "uuid", nullable: false),
|
||||
LastError = table.Column<string>(type: "text", nullable: true),
|
||||
ObjectKey = table.Column<string>(type: "character varying(1024)", maxLength: 1024, nullable: false),
|
||||
RealmName = table.Column<string>(type: "character varying(100)", maxLength: 100, nullable: false),
|
||||
SizeBytes = table.Column<long>(type: "bigint", nullable: false),
|
||||
Status = table.Column<int>(type: "integer", nullable: false),
|
||||
StorageLinkId = table.Column<Guid>(type: "uuid", nullable: true),
|
||||
TenantId = table.Column<Guid>(type: "uuid", nullable: false)
|
||||
},
|
||||
constraints: table =>
|
||||
{
|
||||
table.PrimaryKey("PK_KeycloakBackups", x => x.Id);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakBackups_KeycloakRealms_KeycloakRealmId",
|
||||
column: x => x.KeycloakRealmId,
|
||||
principalTable: "KeycloakRealms",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Cascade);
|
||||
table.ForeignKey(
|
||||
name: "FK_KeycloakBackups_StorageLinks_StorageLinkId",
|
||||
column: x => x.StorageLinkId,
|
||||
principalTable: "StorageLinks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
});
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StorageLinkId",
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakBackups_KeycloakRealmId",
|
||||
table: "KeycloakBackups",
|
||||
type: "uuid",
|
||||
nullable: true,
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid");
|
||||
column: "KeycloakRealmId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_KeycloakBackups_StorageLinks_StorageLinkId",
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_KeycloakBackups_StorageLinkId",
|
||||
table: "KeycloakBackups",
|
||||
column: "StorageLinkId",
|
||||
principalTable: "StorageLinks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.SetNull);
|
||||
column: "StorageLinkId");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_KeycloakBackups_StorageLinks_StorageLinkId",
|
||||
table: "KeycloakBackups");
|
||||
|
||||
migrationBuilder.AlterColumn<Guid>(
|
||||
name: "StorageLinkId",
|
||||
table: "KeycloakBackups",
|
||||
type: "uuid",
|
||||
nullable: false,
|
||||
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
|
||||
oldClrType: typeof(Guid),
|
||||
oldType: "uuid",
|
||||
oldNullable: true);
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_KeycloakBackups_StorageLinks_StorageLinkId",
|
||||
table: "KeycloakBackups",
|
||||
column: "StorageLinkId",
|
||||
principalTable: "StorageLinks",
|
||||
principalColumn: "Id",
|
||||
onDelete: ReferentialAction.Restrict);
|
||||
migrationBuilder.DropTable(name: "KeycloakBackups");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user