diff --git a/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.Designer.cs b/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.Designer.cs
new file mode 100644
index 00000000000..41d914b95ce
--- /dev/null
+++ b/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.Designer.cs
@@ -0,0 +1,245 @@
+//
+using System;
+using Altinn.Studio.Designer.Repository.ORMImplementation.Data;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Infrastructure;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Microsoft.EntityFrameworkCore.Storage.ValueConversion;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Altinn.Studio.Designer.Migrations
+{
+ [DbContext(typeof(DesignerdbContext))]
+ [Migration("20250107083119_AddBuildsTable")]
+ partial class AddBuildsTable
+ {
+ ///
+ protected override void BuildTargetModel(ModelBuilder modelBuilder)
+ {
+#pragma warning disable 612, 618
+ modelBuilder
+ .HasAnnotation("ProductVersion", "9.0.0")
+ .HasAnnotation("Relational:MaxIdentifierLength", 63);
+
+ NpgsqlModelBuilderExtensions.UseSerialColumns(modelBuilder);
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.AppScopesDbObject", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("App")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("app");
+
+ b.Property("Created")
+ .HasColumnType("timestamptz")
+ .HasColumnName("created");
+
+ b.Property("CreatedBy")
+ .HasColumnType("character varying")
+ .HasColumnName("created_by");
+
+ b.Property("LastModifiedBy")
+ .HasColumnType("character varying")
+ .HasColumnName("last_modified_by");
+
+ b.Property("Org")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("org");
+
+ b.Property("Scopes")
+ .IsRequired()
+ .HasColumnType("jsonb")
+ .HasColumnName("scopes");
+
+ b.Property("Version")
+ .IsConcurrencyToken()
+ .ValueGeneratedOnAddOrUpdate()
+ .HasColumnType("xid")
+ .HasColumnName("xmin");
+
+ b.HasKey("Id")
+ .HasName("app_scopes_pkey");
+
+ b.HasIndex(new[] { "Org", "App" }, "idx_app_scopes_org_app")
+ .IsUnique();
+
+ b.ToTable("app_scopes", "designer");
+ });
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("BuildType")
+ .HasColumnType("integer")
+ .HasColumnName("build_type");
+
+ b.Property("ExternalId")
+ .HasColumnType("character varying")
+ .HasColumnName("external_id");
+
+ b.Property("Finished")
+ .HasColumnType("timestamptz")
+ .HasColumnName("finished");
+
+ b.Property("Result")
+ .HasColumnType("character varying")
+ .HasColumnName("result");
+
+ b.Property("Started")
+ .HasColumnType("timestamptz")
+ .HasColumnName("started");
+
+ b.Property("Status")
+ .HasColumnType("character varying")
+ .HasColumnName("status");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BuildType");
+
+ b.HasIndex("ExternalId", "BuildType")
+ .IsUnique();
+
+ b.ToTable("builds", "designer");
+ });
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
+ {
+ b.Property("Sequenceno")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("BIGSERIAL")
+ .HasColumnName("sequenceno");
+
+ NpgsqlPropertyBuilderExtensions.UseSerialColumn(b.Property("Sequenceno"));
+
+ b.Property("App")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("app");
+
+ b.Property("Buildid")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("buildid");
+
+ b.Property("Buildresult")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("buildresult");
+
+ b.Property("Created")
+ .HasColumnType("timestamptz")
+ .HasColumnName("created");
+
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("created_by");
+
+ b.Property("Entity")
+ .IsRequired()
+ .HasColumnType("text")
+ .HasColumnName("entity");
+
+ b.Property("InternalBuildId")
+ .HasColumnType("bigint")
+ .HasColumnName("internal_build_id");
+
+ b.Property("Org")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("org");
+
+ b.Property("Tagname")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("tagname");
+
+ b.HasKey("Sequenceno")
+ .HasName("deployments_pkey");
+
+ b.HasIndex("InternalBuildId");
+
+ b.HasIndex(new[] { "Org", "App" }, "idx_deployments_org_app");
+
+ b.ToTable("deployments", "designer");
+ });
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Release", b =>
+ {
+ b.Property("Sequenceno")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("BIGSERIAL")
+ .HasColumnName("sequenceno");
+
+ NpgsqlPropertyBuilderExtensions.UseSerialColumn(b.Property("Sequenceno"));
+
+ b.Property("App")
+ .HasColumnType("character varying")
+ .HasColumnName("app");
+
+ b.Property("Buildid")
+ .HasColumnType("character varying")
+ .HasColumnName("buildid");
+
+ b.Property("Buildresult")
+ .HasColumnType("character varying")
+ .HasColumnName("buildresult");
+
+ b.Property("Buildstatus")
+ .HasColumnType("character varying")
+ .HasColumnName("buildstatus");
+
+ b.Property("Created")
+ .HasColumnType("timestamptz")
+ .HasColumnName("created");
+
+ b.Property("Entity")
+ .HasColumnType("text")
+ .HasColumnName("entity");
+
+ b.Property("Org")
+ .HasColumnType("character varying")
+ .HasColumnName("org");
+
+ b.Property("Tagname")
+ .HasColumnType("character varying")
+ .HasColumnName("tagname");
+
+ b.HasKey("Sequenceno")
+ .HasName("releases_pkey");
+
+ b.HasIndex(new[] { "Org", "App" }, "idx_releases_org_app");
+
+ b.ToTable("releases", "designer");
+ });
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
+ {
+ b.HasOne("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", "Build")
+ .WithMany()
+ .HasForeignKey("InternalBuildId")
+ .HasConstraintName("fk_deployments_builds_buildid");
+
+ b.Navigation("Build");
+ });
+#pragma warning restore 612, 618
+ }
+ }
+}
diff --git a/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.cs b/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.cs
new file mode 100644
index 00000000000..1163141d7cc
--- /dev/null
+++ b/backend/src/Designer/Migrations/20250107083119_AddBuildsTable.cs
@@ -0,0 +1,226 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+using Npgsql.EntityFrameworkCore.PostgreSQL.Metadata;
+
+#nullable disable
+
+namespace Altinn.Studio.Designer.Migrations
+{
+ ///
+ public partial class AddBuildsTable : Migration
+ {
+ ///
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AlterColumn(
+ name: "tagname",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "character varying",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "org",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "character varying",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "entity",
+ schema: "designer",
+ table: "deployments",
+ type: "text",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "text",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "buildresult",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "character varying",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "buildid",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "character varying",
+ oldNullable: true);
+
+ migrationBuilder.AlterColumn(
+ name: "app",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "",
+ oldClrType: typeof(string),
+ oldType: "character varying",
+ oldNullable: true);
+
+ migrationBuilder.AddColumn(
+ name: "created_by",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: false,
+ defaultValue: "");
+
+ migrationBuilder.AddColumn(
+ name: "internal_build_id",
+ schema: "designer",
+ table: "deployments",
+ type: "bigint",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "builds",
+ schema: "designer",
+ columns: table => new
+ {
+ id = table.Column(type: "bigint", nullable: false)
+ .Annotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.IdentityByDefaultColumn),
+ external_id = table.Column(type: "character varying", nullable: true),
+ status = table.Column(type: "character varying", nullable: true),
+ result = table.Column(type: "character varying", nullable: true),
+ build_type = table.Column(type: "integer", nullable: false),
+ started = table.Column(type: "timestamptz", nullable: true),
+ finished = table.Column(type: "timestamptz", nullable: true)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("PK_builds", x => x.id);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "IX_deployments_internal_build_id",
+ schema: "designer",
+ table: "deployments",
+ column: "internal_build_id");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_builds_build_type",
+ schema: "designer",
+ table: "builds",
+ column: "build_type");
+
+ migrationBuilder.CreateIndex(
+ name: "IX_builds_external_id_build_type",
+ schema: "designer",
+ table: "builds",
+ columns: new[] { "external_id", "build_type" },
+ unique: true);
+
+ migrationBuilder.AddForeignKey(
+ name: "fk_deployments_builds_buildid",
+ schema: "designer",
+ table: "deployments",
+ column: "internal_build_id",
+ principalSchema: "designer",
+ principalTable: "builds",
+ principalColumn: "id");
+ }
+
+ ///
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropForeignKey(
+ name: "fk_deployments_builds_buildid",
+ schema: "designer",
+ table: "deployments");
+
+ migrationBuilder.DropTable(
+ name: "builds",
+ schema: "designer");
+
+ migrationBuilder.DropIndex(
+ name: "IX_deployments_internal_build_id",
+ schema: "designer",
+ table: "deployments");
+
+ migrationBuilder.DropColumn(
+ name: "created_by",
+ schema: "designer",
+ table: "deployments");
+
+ migrationBuilder.DropColumn(
+ name: "internal_build_id",
+ schema: "designer",
+ table: "deployments");
+
+ migrationBuilder.AlterColumn(
+ name: "tagname",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying");
+
+ migrationBuilder.AlterColumn(
+ name: "org",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying");
+
+ migrationBuilder.AlterColumn(
+ name: "entity",
+ schema: "designer",
+ table: "deployments",
+ type: "text",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "text");
+
+ migrationBuilder.AlterColumn(
+ name: "buildresult",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying");
+
+ migrationBuilder.AlterColumn(
+ name: "buildid",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying");
+
+ migrationBuilder.AlterColumn(
+ name: "app",
+ schema: "designer",
+ table: "deployments",
+ type: "character varying",
+ nullable: true,
+ oldClrType: typeof(string),
+ oldType: "character varying");
+ }
+ }
+}
diff --git a/backend/src/Designer/Migrations/DesignerdbContextModelSnapshot.cs b/backend/src/Designer/Migrations/DesignerdbContextModelSnapshot.cs
index 56876fa4667..a7ce78d21a4 100644
--- a/backend/src/Designer/Migrations/DesignerdbContextModelSnapshot.cs
+++ b/backend/src/Designer/Migrations/DesignerdbContextModelSnapshot.cs
@@ -73,6 +73,49 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("app_scopes", "designer");
});
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", b =>
+ {
+ b.Property("Id")
+ .ValueGeneratedOnAdd()
+ .HasColumnType("bigint")
+ .HasColumnName("id");
+
+ NpgsqlPropertyBuilderExtensions.UseIdentityByDefaultColumn(b.Property("Id"));
+
+ b.Property("BuildType")
+ .HasColumnType("integer")
+ .HasColumnName("build_type");
+
+ b.Property("ExternalId")
+ .HasColumnType("character varying")
+ .HasColumnName("external_id");
+
+ b.Property("Finished")
+ .HasColumnType("timestamptz")
+ .HasColumnName("finished");
+
+ b.Property("Result")
+ .HasColumnType("character varying")
+ .HasColumnName("result");
+
+ b.Property("Started")
+ .HasColumnType("timestamptz")
+ .HasColumnName("started");
+
+ b.Property("Status")
+ .HasColumnType("character varying")
+ .HasColumnName("status");
+
+ b.HasKey("Id");
+
+ b.HasIndex("BuildType");
+
+ b.HasIndex("ExternalId", "BuildType")
+ .IsUnique();
+
+ b.ToTable("builds", "designer");
+ });
+
modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
{
b.Property("Sequenceno")
@@ -83,14 +126,17 @@ protected override void BuildModel(ModelBuilder modelBuilder)
NpgsqlPropertyBuilderExtensions.UseSerialColumn(b.Property("Sequenceno"));
b.Property("App")
+ .IsRequired()
.HasColumnType("character varying")
.HasColumnName("app");
b.Property("Buildid")
+ .IsRequired()
.HasColumnType("character varying")
.HasColumnName("buildid");
b.Property("Buildresult")
+ .IsRequired()
.HasColumnType("character varying")
.HasColumnName("buildresult");
@@ -98,21 +144,35 @@ protected override void BuildModel(ModelBuilder modelBuilder)
.HasColumnType("timestamptz")
.HasColumnName("created");
+ b.Property("CreatedBy")
+ .IsRequired()
+ .HasColumnType("character varying")
+ .HasColumnName("created_by");
+
b.Property("Entity")
+ .IsRequired()
.HasColumnType("text")
.HasColumnName("entity");
+ b.Property("InternalBuildId")
+ .HasColumnType("bigint")
+ .HasColumnName("internal_build_id");
+
b.Property("Org")
+ .IsRequired()
.HasColumnType("character varying")
.HasColumnName("org");
b.Property("Tagname")
+ .IsRequired()
.HasColumnType("character varying")
.HasColumnName("tagname");
b.HasKey("Sequenceno")
.HasName("deployments_pkey");
+ b.HasIndex("InternalBuildId");
+
b.HasIndex(new[] { "Org", "App" }, "idx_deployments_org_app");
b.ToTable("deployments", "designer");
@@ -166,6 +226,16 @@ protected override void BuildModel(ModelBuilder modelBuilder)
b.ToTable("releases", "designer");
});
+
+ modelBuilder.Entity("Altinn.Studio.Designer.Repository.ORMImplementation.Models.Deployment", b =>
+ {
+ b.HasOne("Altinn.Studio.Designer.Repository.ORMImplementation.Models.BuildDbObject", "Build")
+ .WithMany()
+ .HasForeignKey("InternalBuildId")
+ .HasConstraintName("fk_deployments_builds_buildid");
+
+ b.Navigation("Build");
+ });
#pragma warning restore 612, 618
}
}