gateway api fixes

This commit is contained in:
Nils Blomgren
2026-05-21 16:57:50 +02:00
parent 8b94fb8826
commit e0f967482e
68 changed files with 44082 additions and 437 deletions

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,29 @@
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntKube.Web.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class AddCnpgRetentionDays : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<int>(
name: "RetentionDays",
table: "CnpgClusters",
type: "INTEGER",
nullable: false,
defaultValue: 0);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropColumn(
name: "RetentionDays",
table: "CnpgClusters");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,175 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntKube.Web.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class AddMongoEntities : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "MongoDatabaseId",
table: "VaultSecrets",
type: "TEXT",
nullable: true);
migrationBuilder.CreateTable(
name: "MongoClusters",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
TenantId = table.Column<Guid>(type: "TEXT", nullable: false),
KubernetesClusterId = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 63, nullable: false),
Namespace = table.Column<string>(type: "TEXT", maxLength: 63, nullable: false),
MongoVersion = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
Members = table.Column<int>(type: "INTEGER", nullable: false),
StorageSize = table.Column<string>(type: "TEXT", maxLength: 20, nullable: false),
StorageLinkId = table.Column<Guid>(type: "TEXT", nullable: true),
BackupSchedule = table.Column<string>(type: "TEXT", maxLength: 100, nullable: true),
RetentionDays = table.Column<int>(type: "INTEGER", nullable: false),
Status = table.Column<int>(type: "INTEGER", nullable: false),
LastError = table.Column<string>(type: "TEXT", nullable: true),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MongoClusters", x => x.Id);
table.ForeignKey(
name: "FK_MongoClusters_KubernetesClusters_KubernetesClusterId",
column: x => x.KubernetesClusterId,
principalTable: "KubernetesClusters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_MongoClusters_StorageLinks_StorageLinkId",
column: x => x.StorageLinkId,
principalTable: "StorageLinks",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_MongoClusters_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "MongoBackups",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
MongoClusterId = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 253, nullable: false),
Type = table.Column<int>(type: "INTEGER", nullable: false),
Status = table.Column<int>(type: "INTEGER", nullable: false),
StartedAt = table.Column<DateTime>(type: "TEXT", nullable: false),
CompletedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
SizeBytes = table.Column<long>(type: "INTEGER", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_MongoBackups", x => x.Id);
table.ForeignKey(
name: "FK_MongoBackups_MongoClusters_MongoClusterId",
column: x => x.MongoClusterId,
principalTable: "MongoClusters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateTable(
name: "MongoDatabases",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
MongoClusterId = table.Column<Guid>(type: "TEXT", nullable: false),
Name = table.Column<string>(type: "TEXT", maxLength: 63, nullable: false),
Owner = table.Column<string>(type: "TEXT", nullable: false),
Status = table.Column<int>(type: "INTEGER", nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_MongoDatabases", x => x.Id);
table.ForeignKey(
name: "FK_MongoDatabases_MongoClusters_MongoClusterId",
column: x => x.MongoClusterId,
principalTable: "MongoClusters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_VaultSecrets_MongoDatabaseId",
table: "VaultSecrets",
column: "MongoDatabaseId");
migrationBuilder.CreateIndex(
name: "IX_MongoBackups_MongoClusterId_Name",
table: "MongoBackups",
columns: new[] { "MongoClusterId", "Name" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_MongoClusters_KubernetesClusterId_Name_Namespace",
table: "MongoClusters",
columns: new[] { "KubernetesClusterId", "Name", "Namespace" },
unique: true);
migrationBuilder.CreateIndex(
name: "IX_MongoClusters_StorageLinkId",
table: "MongoClusters",
column: "StorageLinkId");
migrationBuilder.CreateIndex(
name: "IX_MongoClusters_TenantId",
table: "MongoClusters",
column: "TenantId");
migrationBuilder.CreateIndex(
name: "IX_MongoDatabases_MongoClusterId_Name",
table: "MongoDatabases",
columns: new[] { "MongoClusterId", "Name" },
unique: true);
migrationBuilder.AddForeignKey(
name: "FK_VaultSecrets_MongoDatabases_MongoDatabaseId",
table: "VaultSecrets",
column: "MongoDatabaseId",
principalTable: "MongoDatabases",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_VaultSecrets_MongoDatabases_MongoDatabaseId",
table: "VaultSecrets");
migrationBuilder.DropTable(
name: "MongoBackups");
migrationBuilder.DropTable(
name: "MongoDatabases");
migrationBuilder.DropTable(
name: "MongoClusters");
migrationBuilder.DropIndex(
name: "IX_VaultSecrets_MongoDatabaseId",
table: "VaultSecrets");
migrationBuilder.DropColumn(
name: "MongoDatabaseId",
table: "VaultSecrets");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,73 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntKube.Web.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class AddDatabaseBindings : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "DatabaseBindings",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
CnpgDatabaseId = table.Column<Guid>(type: "TEXT", nullable: true),
MongoDatabaseId = table.Column<Guid>(type: "TEXT", nullable: true),
AppDeploymentId = table.Column<Guid>(type: "TEXT", nullable: false),
KubernetesSecretName = table.Column<string>(type: "TEXT", maxLength: 253, nullable: false),
SyncEnabled = table.Column<bool>(type: "INTEGER", nullable: false),
LastSyncedAt = table.Column<DateTime>(type: "TEXT", nullable: true),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_DatabaseBindings", x => x.Id);
table.ForeignKey(
name: "FK_DatabaseBindings_AppDeployments_AppDeploymentId",
column: x => x.AppDeploymentId,
principalTable: "AppDeployments",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DatabaseBindings_CnpgDatabases_CnpgDatabaseId",
column: x => x.CnpgDatabaseId,
principalTable: "CnpgDatabases",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_DatabaseBindings_MongoDatabases_MongoDatabaseId",
column: x => x.MongoDatabaseId,
principalTable: "MongoDatabases",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_DatabaseBindings_AppDeploymentId",
table: "DatabaseBindings",
column: "AppDeploymentId");
migrationBuilder.CreateIndex(
name: "IX_DatabaseBindings_CnpgDatabaseId",
table: "DatabaseBindings",
column: "CnpgDatabaseId");
migrationBuilder.CreateIndex(
name: "IX_DatabaseBindings_MongoDatabaseId",
table: "DatabaseBindings",
column: "MongoDatabaseId");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "DatabaseBindings");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,50 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntKube.Web.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class AddMongoClusterVaultSecret : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "MongoClusterId",
table: "VaultSecrets",
type: "TEXT",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_VaultSecrets_MongoClusterId",
table: "VaultSecrets",
column: "MongoClusterId");
migrationBuilder.AddForeignKey(
name: "FK_VaultSecrets_MongoClusters_MongoClusterId",
table: "VaultSecrets",
column: "MongoClusterId",
principalTable: "MongoClusters",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_VaultSecrets_MongoClusters_MongoClusterId",
table: "VaultSecrets");
migrationBuilder.DropIndex(
name: "IX_VaultSecrets_MongoClusterId",
table: "VaultSecrets");
migrationBuilder.DropColumn(
name: "MongoClusterId",
table: "VaultSecrets");
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,200 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace EntKube.Web.Data.Migrations.Sqlite
{
/// <inheritdoc />
public partial class AddKeycloakComponentConfig : Migration
{
/// <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");
migrationBuilder.CreateTable(
name: "KeycloakComponentConfigs",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
TenantId = table.Column<Guid>(type: "TEXT", nullable: false),
ClusterComponentId = table.Column<Guid>(type: "TEXT", nullable: false),
CnpgDatabaseId = table.Column<Guid>(type: "TEXT", nullable: true),
AdminUsername = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
AdminUrl = table.Column<string>(type: "TEXT", maxLength: 500, nullable: true),
CreatedAt = table.Column<DateTime>(type: "TEXT", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_KeycloakComponentConfigs", x => x.Id);
table.ForeignKey(
name: "FK_KeycloakComponentConfigs_ClusterComponents_ClusterComponentId",
column: x => x.ClusterComponentId,
principalTable: "ClusterComponents",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
table.ForeignKey(
name: "FK_KeycloakComponentConfigs_CnpgDatabases_CnpgDatabaseId",
column: x => x.CnpgDatabaseId,
principalTable: "CnpgDatabases",
principalColumn: "Id",
onDelete: ReferentialAction.SetNull);
table.ForeignKey(
name: "FK_KeycloakComponentConfigs_Tenants_TenantId",
column: x => x.TenantId,
principalTable: "Tenants",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
});
migrationBuilder.CreateIndex(
name: "IX_KeycloakComponentConfigs_ClusterComponentId",
table: "KeycloakComponentConfigs",
column: "ClusterComponentId");
migrationBuilder.CreateIndex(
name: "IX_KeycloakComponentConfigs_CnpgDatabaseId",
table: "KeycloakComponentConfigs",
column: "CnpgDatabaseId");
migrationBuilder.CreateIndex(
name: "IX_KeycloakComponentConfigs_TenantId",
table: "KeycloakComponentConfigs",
column: "TenantId");
migrationBuilder.AddForeignKey(
name: "FK_KeycloakRealms_KeycloakComponentConfigs_KeycloakComponentConfigId",
table: "KeycloakRealms",
column: "KeycloakComponentConfigId",
principalTable: "KeycloakComponentConfigs",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_KeycloakRealms_KeycloakComponentConfigs_KeycloakComponentConfigId",
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: "TEXT",
nullable: true);
migrationBuilder.CreateTable(
name: "KeycloakConnections",
columns: table => new
{
Id = table.Column<Guid>(type: "TEXT", nullable: false),
AdminPasswordSecretId = table.Column<Guid>(type: "TEXT", nullable: true),
KubernetesClusterId = table.Column<Guid>(type: "TEXT", nullable: false),
TenantId = table.Column<Guid>(type: "TEXT", nullable: false),
AdminUrl = table.Column<string>(type: "TEXT", maxLength: 500, nullable: false),
AdminUsername = table.Column<string>(type: "TEXT", maxLength: 100, nullable: false),
CreatedAt = table.Column<DateTime>(type: "TEXT", 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);
}
}
}

View File

@@ -337,6 +337,9 @@ namespace EntKube.Web.Data.Migrations.Sqlite
.HasMaxLength(10)
.HasColumnType("TEXT");
b.Property<int>("RetentionDays")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");
@@ -444,6 +447,46 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.ToTable("CustomerAccesses");
});
modelBuilder.Entity("EntKube.Web.Data.DatabaseBinding", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<Guid>("AppDeploymentId")
.HasColumnType("TEXT");
b.Property<Guid?>("CnpgDatabaseId")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("KubernetesSecretName")
.IsRequired()
.HasMaxLength(253)
.HasColumnType("TEXT");
b.Property<DateTime?>("LastSyncedAt")
.HasColumnType("TEXT");
b.Property<Guid?>("MongoDatabaseId")
.HasColumnType("TEXT");
b.Property<bool>("SyncEnabled")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("AppDeploymentId");
b.HasIndex("CnpgDatabaseId");
b.HasIndex("MongoDatabaseId");
b.ToTable("DatabaseBindings");
});
modelBuilder.Entity("EntKube.Web.Data.DeploymentManifest", b =>
{
b.Property<Guid>("Id")
@@ -674,6 +717,140 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.ToTable("GroupMemberships");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakBackup", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<Guid>("KeycloakRealmId")
.HasColumnType("TEXT");
b.Property<string>("LastError")
.HasColumnType("TEXT");
b.Property<string>("ObjectKey")
.IsRequired()
.HasMaxLength(1024)
.HasColumnType("TEXT");
b.Property<string>("RealmName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<long>("SizeBytes")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<Guid>("StorageLinkId")
.HasColumnType("TEXT");
b.Property<Guid>("TenantId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("KeycloakRealmId");
b.HasIndex("StorageLinkId");
b.ToTable("KeycloakBackups");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakComponentConfig", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AdminUrl")
.HasMaxLength(500)
.HasColumnType("TEXT");
b.Property<string>("AdminUsername")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<Guid>("ClusterComponentId")
.HasColumnType("TEXT");
b.Property<Guid?>("CnpgDatabaseId")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<Guid>("TenantId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("ClusterComponentId");
b.HasIndex("CnpgDatabaseId");
b.HasIndex("TenantId");
b.ToTable("KeycloakComponentConfigs");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakRealm", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("AccountTheme")
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<string>("DisplayName")
.IsRequired()
.HasMaxLength(200)
.HasColumnType("TEXT");
b.Property<bool>("Enabled")
.HasColumnType("INTEGER");
b.Property<Guid>("KeycloakComponentConfigId")
.HasColumnType("TEXT");
b.Property<Guid?>("LinkedAppId")
.HasColumnType("TEXT");
b.Property<string>("LoginTheme")
.HasColumnType("TEXT");
b.Property<string>("RealmName")
.IsRequired()
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<Guid>("TenantId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("LinkedAppId");
b.HasIndex("KeycloakComponentConfigId", "RealmName")
.IsUnique();
b.ToTable("KeycloakRealms");
});
modelBuilder.Entity("EntKube.Web.Data.KubernetesCluster", b =>
{
b.Property<Guid>("Id")
@@ -715,6 +892,141 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.ToTable("KubernetesClusters");
});
modelBuilder.Entity("EntKube.Web.Data.MongoBackup", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime?>("CompletedAt")
.HasColumnType("TEXT");
b.Property<Guid>("MongoClusterId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(253)
.HasColumnType("TEXT");
b.Property<long?>("SizeBytes")
.HasColumnType("INTEGER");
b.Property<DateTime>("StartedAt")
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<int>("Type")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("MongoClusterId", "Name")
.IsUnique();
b.ToTable("MongoBackups");
});
modelBuilder.Entity("EntKube.Web.Data.MongoCluster", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<string>("BackupSchedule")
.HasMaxLength(100)
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<Guid>("KubernetesClusterId")
.HasColumnType("TEXT");
b.Property<string>("LastError")
.HasColumnType("TEXT");
b.Property<int>("Members")
.HasColumnType("INTEGER");
b.Property<string>("MongoVersion")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(63)
.HasColumnType("TEXT");
b.Property<string>("Namespace")
.IsRequired()
.HasMaxLength(63)
.HasColumnType("TEXT");
b.Property<int>("RetentionDays")
.HasColumnType("INTEGER");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.Property<Guid?>("StorageLinkId")
.HasColumnType("TEXT");
b.Property<string>("StorageSize")
.IsRequired()
.HasMaxLength(20)
.HasColumnType("TEXT");
b.Property<Guid>("TenantId")
.HasColumnType("TEXT");
b.HasKey("Id");
b.HasIndex("StorageLinkId");
b.HasIndex("TenantId");
b.HasIndex("KubernetesClusterId", "Name", "Namespace")
.IsUnique();
b.ToTable("MongoClusters");
});
modelBuilder.Entity("EntKube.Web.Data.MongoDatabase", b =>
{
b.Property<Guid>("Id")
.ValueGeneratedOnAdd()
.HasColumnType("TEXT");
b.Property<DateTime>("CreatedAt")
.HasColumnType("TEXT");
b.Property<Guid>("MongoClusterId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(63)
.HasColumnType("TEXT");
b.Property<string>("Owner")
.IsRequired()
.HasColumnType("TEXT");
b.Property<int>("Status")
.HasColumnType("INTEGER");
b.HasKey("Id");
b.HasIndex("MongoClusterId", "Name")
.IsUnique();
b.ToTable("MongoDatabases");
});
modelBuilder.Entity("EntKube.Web.Data.OpenStackConnection", b =>
{
b.Property<Guid>("Id")
@@ -983,6 +1295,12 @@ namespace EntKube.Web.Data.Migrations.Sqlite
.HasMaxLength(253)
.HasColumnType("TEXT");
b.Property<Guid?>("MongoClusterId")
.HasColumnType("TEXT");
b.Property<Guid?>("MongoDatabaseId")
.HasColumnType("TEXT");
b.Property<string>("Name")
.IsRequired()
.HasMaxLength(200)
@@ -1015,6 +1333,10 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.HasIndex("ComponentId");
b.HasIndex("MongoClusterId");
b.HasIndex("MongoDatabaseId");
b.HasIndex("StorageLinkId");
b.HasIndex("VaultId", "AppId", "Name")
@@ -1300,6 +1622,31 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("User");
});
modelBuilder.Entity("EntKube.Web.Data.DatabaseBinding", b =>
{
b.HasOne("EntKube.Web.Data.AppDeployment", "AppDeployment")
.WithMany("DatabaseBindings")
.HasForeignKey("AppDeploymentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntKube.Web.Data.CnpgDatabase", "CnpgDatabase")
.WithMany("DatabaseBindings")
.HasForeignKey("CnpgDatabaseId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("EntKube.Web.Data.MongoDatabase", "MongoDatabase")
.WithMany("DatabaseBindings")
.HasForeignKey("MongoDatabaseId")
.OnDelete(DeleteBehavior.Cascade);
b.Navigation("AppDeployment");
b.Navigation("CnpgDatabase");
b.Navigation("MongoDatabase");
});
modelBuilder.Entity("EntKube.Web.Data.DeploymentManifest", b =>
{
b.HasOne("EntKube.Web.Data.AppDeployment", "Deployment")
@@ -1381,6 +1728,69 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("User");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakBackup", b =>
{
b.HasOne("EntKube.Web.Data.KeycloakRealm", "Realm")
.WithMany("Backups")
.HasForeignKey("KeycloakRealmId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntKube.Web.Data.StorageLink", "StorageLink")
.WithMany()
.HasForeignKey("StorageLinkId")
.OnDelete(DeleteBehavior.Restrict)
.IsRequired();
b.Navigation("Realm");
b.Navigation("StorageLink");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakComponentConfig", b =>
{
b.HasOne("EntKube.Web.Data.ClusterComponent", "ClusterComponent")
.WithMany()
.HasForeignKey("ClusterComponentId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntKube.Web.Data.CnpgDatabase", "CnpgDatabase")
.WithMany()
.HasForeignKey("CnpgDatabaseId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("EntKube.Web.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("ClusterComponent");
b.Navigation("CnpgDatabase");
b.Navigation("Tenant");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakRealm", b =>
{
b.HasOne("EntKube.Web.Data.KeycloakComponentConfig", "ComponentConfig")
.WithMany("Realms")
.HasForeignKey("KeycloakComponentConfigId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntKube.Web.Data.App", "LinkedApp")
.WithMany()
.HasForeignKey("LinkedAppId")
.OnDelete(DeleteBehavior.SetNull);
b.Navigation("ComponentConfig");
b.Navigation("LinkedApp");
});
modelBuilder.Entity("EntKube.Web.Data.KubernetesCluster", b =>
{
b.HasOne("EntKube.Web.Data.Environment", "Environment")
@@ -1400,6 +1810,54 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("Tenant");
});
modelBuilder.Entity("EntKube.Web.Data.MongoBackup", b =>
{
b.HasOne("EntKube.Web.Data.MongoCluster", "MongoCluster")
.WithMany("Backups")
.HasForeignKey("MongoClusterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MongoCluster");
});
modelBuilder.Entity("EntKube.Web.Data.MongoCluster", b =>
{
b.HasOne("EntKube.Web.Data.KubernetesCluster", "KubernetesCluster")
.WithMany()
.HasForeignKey("KubernetesClusterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.HasOne("EntKube.Web.Data.StorageLink", "StorageLink")
.WithMany()
.HasForeignKey("StorageLinkId")
.OnDelete(DeleteBehavior.SetNull);
b.HasOne("EntKube.Web.Data.Tenant", "Tenant")
.WithMany()
.HasForeignKey("TenantId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("KubernetesCluster");
b.Navigation("StorageLink");
b.Navigation("Tenant");
});
modelBuilder.Entity("EntKube.Web.Data.MongoDatabase", b =>
{
b.HasOne("EntKube.Web.Data.MongoCluster", "MongoCluster")
.WithMany("Databases")
.HasForeignKey("MongoClusterId")
.OnDelete(DeleteBehavior.Cascade)
.IsRequired();
b.Navigation("MongoCluster");
});
modelBuilder.Entity("EntKube.Web.Data.OpenStackConnection", b =>
{
b.HasOne("EntKube.Web.Data.Tenant", "Tenant")
@@ -1533,6 +1991,16 @@ namespace EntKube.Web.Data.Migrations.Sqlite
.HasForeignKey("ComponentId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("EntKube.Web.Data.MongoCluster", "MongoCluster")
.WithMany()
.HasForeignKey("MongoClusterId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("EntKube.Web.Data.MongoDatabase", "MongoDatabase")
.WithMany()
.HasForeignKey("MongoDatabaseId")
.OnDelete(DeleteBehavior.Cascade);
b.HasOne("EntKube.Web.Data.StorageLink", "StorageLink")
.WithMany()
.HasForeignKey("StorageLinkId");
@@ -1549,6 +2017,10 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("Component");
b.Navigation("MongoCluster");
b.Navigation("MongoDatabase");
b.Navigation("StorageLink");
b.Navigation("Vault");
@@ -1616,6 +2088,8 @@ namespace EntKube.Web.Data.Migrations.Sqlite
modelBuilder.Entity("EntKube.Web.Data.AppDeployment", b =>
{
b.Navigation("DatabaseBindings");
b.Navigation("Manifests");
b.Navigation("Resources");
@@ -1639,6 +2113,11 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("Databases");
});
modelBuilder.Entity("EntKube.Web.Data.CnpgDatabase", b =>
{
b.Navigation("DatabaseBindings");
});
modelBuilder.Entity("EntKube.Web.Data.Customer", b =>
{
b.Navigation("Apps");
@@ -1661,11 +2140,33 @@ namespace EntKube.Web.Data.Migrations.Sqlite
b.Navigation("Memberships");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakComponentConfig", b =>
{
b.Navigation("Realms");
});
modelBuilder.Entity("EntKube.Web.Data.KeycloakRealm", b =>
{
b.Navigation("Backups");
});
modelBuilder.Entity("EntKube.Web.Data.KubernetesCluster", b =>
{
b.Navigation("Components");
});
modelBuilder.Entity("EntKube.Web.Data.MongoCluster", b =>
{
b.Navigation("Backups");
b.Navigation("Databases");
});
modelBuilder.Entity("EntKube.Web.Data.MongoDatabase", b =>
{
b.Navigation("DatabaseBindings");
});
modelBuilder.Entity("EntKube.Web.Data.OpenStackConnection", b =>
{
b.Navigation("StorageLinks");