From df0737e55afeb5c01eb39909605970d1d3a73ffc Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Sun, 13 Sep 2026 13:22:20 +1000 Subject: refactor: cleanup; feat: connection to agent --- .../ApplicationDbContextModelSnapshot.cs | 204 +++++++++++++++------ 1 file changed, 144 insertions(+), 60 deletions(-) (limited to 'src/marlin.web/Migrations/ApplicationDbContextModelSnapshot.cs') diff --git a/src/marlin.web/Migrations/ApplicationDbContextModelSnapshot.cs b/src/marlin.web/Migrations/ApplicationDbContextModelSnapshot.cs index 8de35de..411706b 100644 --- a/src/marlin.web/Migrations/ApplicationDbContextModelSnapshot.cs +++ b/src/marlin.web/Migrations/ApplicationDbContextModelSnapshot.cs @@ -22,13 +22,18 @@ namespace marlin.web.Migrations NpgsqlModelBuilderExtensions.UseIdentityByDefaultColumns(modelBuilder); - modelBuilder.Entity("marlin.core.models.Agent", b => + modelBuilder.Entity("marlin.web.Models.Agent", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid") .HasColumnName("id"); + b.Property("AuthToken") + .IsRequired() + .HasColumnType("text") + .HasColumnName("auth_token"); + b.Property("Capabilities") .IsRequired() .HasColumnType("text") @@ -53,7 +58,7 @@ namespace marlin.web.Migrations b.ToTable("agents", (string)null); }); - modelBuilder.Entity("marlin.core.models.Job", b => + modelBuilder.Entity("marlin.web.Models.Job", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -64,10 +69,17 @@ namespace marlin.web.Migrations .HasColumnType("uuid") .HasColumnName("agent_id"); - b.Property("Commit") - .IsRequired() + b.Property("BranchId") + .HasColumnType("uuid") + .HasColumnName("branch_id"); + + b.Property("ClaimToken") .HasColumnType("text") - .HasColumnName("commit"); + .HasColumnName("claim_token"); + + b.Property("CommitId") + .HasColumnType("uuid") + .HasColumnName("commit_id"); b.Property("CreatedAt") .HasColumnType("timestamp with time zone") @@ -83,11 +95,6 @@ namespace marlin.web.Migrations .HasColumnType("text") .HasColumnName("recipe"); - b.Property("Ref") - .IsRequired() - .HasColumnType("text") - .HasColumnName("ref"); - b.Property("SourceId") .HasColumnType("uuid") .HasColumnName("source_id"); @@ -102,13 +109,19 @@ namespace marlin.web.Migrations b.HasIndex("AgentId") .HasDatabaseName("ix_jobs_agent_id"); + b.HasIndex("BranchId") + .HasDatabaseName("ix_jobs_branch_id"); + + b.HasIndex("CommitId") + .HasDatabaseName("ix_jobs_commit_id"); + b.HasIndex("SourceId") .HasDatabaseName("ix_jobs_source_id"); b.ToTable("jobs", (string)null); }); - modelBuilder.Entity("marlin.core.models.JobStatusUpdate", b => + modelBuilder.Entity("marlin.web.Models.JobStatusUpdate", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -136,7 +149,45 @@ namespace marlin.web.Migrations b.ToTable("job_status_update", (string)null); }); - modelBuilder.Entity("marlin.core.models.VersionControlSource", b => + modelBuilder.Entity("marlin.web.Models.VersionControlSecret", b => + { + b.Property("Id") + .ValueGeneratedOnAdd() + .HasColumnType("uuid") + .HasColumnName("id"); + + b.Property("Content") + .IsRequired() + .HasColumnType("text") + .HasColumnName("content"); + + b.Property("Kind") + .HasColumnType("text") + .HasColumnName("kind"); + + b.Property("Label") + .IsRequired() + .HasColumnType("text") + .HasColumnName("label"); + + b.Property("MayReveal") + .HasColumnType("boolean") + .HasColumnName("may_reveal"); + + b.Property("SourceId") + .HasColumnType("uuid") + .HasColumnName("source_id"); + + b.HasKey("Id") + .HasName("pk_secrets"); + + b.HasIndex("SourceId") + .HasDatabaseName("ix_secrets_source_id"); + + b.ToTable("secrets", (string)null); + }); + + modelBuilder.Entity("marlin.web.Models.VersionControlSource", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -172,7 +223,7 @@ namespace marlin.web.Migrations b.ToTable("sources", (string)null); }); - modelBuilder.Entity("marlin.core.models.VersionControlledBlob", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledBlob", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -209,7 +260,7 @@ namespace marlin.web.Migrations b.ToTable("source_blobs", (string)null); }); - modelBuilder.Entity("marlin.core.models.VersionControlledBranch", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledBranch", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -241,7 +292,7 @@ namespace marlin.web.Migrations b.ToTable("source_branches", (string)null); }); - modelBuilder.Entity("marlin.core.models.VersionControlledCommit", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledCommit", b => { b.Property("Id") .ValueGeneratedOnAdd() @@ -261,6 +312,10 @@ namespace marlin.web.Migrations .HasColumnType("uuid") .HasColumnName("source_id"); + b.Property("WorkflowScanned") + .HasColumnType("boolean") + .HasColumnName("workflow_scanned"); + b.HasKey("Id") .HasName("pk_source_commits"); @@ -270,52 +325,58 @@ namespace marlin.web.Migrations b.ToTable("source_commits", (string)null); }); - modelBuilder.Entity("marlin.web.Models.VersionControlSecret", b => + modelBuilder.Entity("marlin.web.Models.WorkflowSnapshot", b => { b.Property("Id") .ValueGeneratedOnAdd() .HasColumnType("uuid") .HasColumnName("id"); - b.Property("Content") - .IsRequired() - .HasColumnType("text") - .HasColumnName("content"); + b.Property("CommitId") + .HasColumnType("uuid") + .HasColumnName("commit_id"); - b.Property("Kind") - .HasColumnType("text") - .HasColumnName("kind"); + b.Property("ScannedAt") + .HasColumnType("timestamp with time zone") + .HasColumnName("scanned_at"); - b.Property("Label") + b.Property("Workflow") .IsRequired() .HasColumnType("text") - .HasColumnName("label"); - - b.Property("MayReveal") - .HasColumnType("boolean") - .HasColumnName("may_reveal"); - - b.Property("SourceId") - .HasColumnType("uuid") - .HasColumnName("source_id"); + .HasColumnName("workflow"); b.HasKey("Id") - .HasName("pk_secrets"); + .HasName("pk_workflow_snapshots"); - b.HasIndex("SourceId") - .HasDatabaseName("ix_secrets_source_id"); + b.HasIndex("CommitId") + .IsUnique() + .HasDatabaseName("ix_workflow_snapshots_commit_id"); - b.ToTable("secrets", (string)null); + b.ToTable("workflow_snapshots", (string)null); }); - modelBuilder.Entity("marlin.core.models.Job", b => + modelBuilder.Entity("marlin.web.Models.Job", b => { - b.HasOne("marlin.core.models.Agent", "Agent") - .WithMany() + b.HasOne("marlin.web.Models.Agent", "Agent") + .WithMany("Jobs") .HasForeignKey("AgentId") .HasConstraintName("fk_jobs_agents_agent_id"); - b.HasOne("marlin.core.models.VersionControlSource", "Source") + b.HasOne("marlin.web.Models.VersionControlledBranch", "Branch") + .WithMany() + .HasForeignKey("BranchId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_jobs_source_branches_branch_id"); + + b.HasOne("marlin.web.Models.VersionControlledCommit", "Commit") + .WithMany() + .HasForeignKey("CommitId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_jobs_source_commits_commit_id"); + + b.HasOne("marlin.web.Models.VersionControlSource", "Source") .WithMany() .HasForeignKey("SourceId") .OnDelete(DeleteBehavior.Cascade) @@ -324,12 +385,16 @@ namespace marlin.web.Migrations b.Navigation("Agent"); + b.Navigation("Branch"); + + b.Navigation("Commit"); + b.Navigation("Source"); }); - modelBuilder.Entity("marlin.core.models.JobStatusUpdate", b => + modelBuilder.Entity("marlin.web.Models.JobStatusUpdate", b => { - b.HasOne("marlin.core.models.Job", "Job") + b.HasOne("marlin.web.Models.Job", "Job") .WithMany("StatusUpdates") .HasForeignKey("JobId") .OnDelete(DeleteBehavior.Cascade) @@ -339,16 +404,28 @@ namespace marlin.web.Migrations b.Navigation("Job"); }); - modelBuilder.Entity("marlin.core.models.VersionControlledBlob", b => + modelBuilder.Entity("marlin.web.Models.VersionControlSecret", b => { - b.HasOne("marlin.core.models.VersionControlledCommit", "Commit") + b.HasOne("marlin.web.Models.VersionControlSource", "Source") + .WithMany() + .HasForeignKey("SourceId") + .OnDelete(DeleteBehavior.Cascade) + .IsRequired() + .HasConstraintName("fk_secrets_sources_source_id"); + + b.Navigation("Source"); + }); + + modelBuilder.Entity("marlin.web.Models.VersionControlledBlob", b => + { + b.HasOne("marlin.web.Models.VersionControlledCommit", "Commit") .WithMany("Blobs") .HasForeignKey("CommitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_source_blobs_source_commits_commit_id"); - b.HasOne("marlin.core.models.VersionControlSource", "Source") + b.HasOne("marlin.web.Models.VersionControlSource", "Source") .WithMany() .HasForeignKey("SourceId") .OnDelete(DeleteBehavior.Cascade) @@ -360,16 +437,16 @@ namespace marlin.web.Migrations b.Navigation("Source"); }); - modelBuilder.Entity("marlin.core.models.VersionControlledBranch", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledBranch", b => { - b.HasOne("marlin.core.models.VersionControlledCommit", "Commit") + b.HasOne("marlin.web.Models.VersionControlledCommit", "Commit") .WithMany("Branches") .HasForeignKey("CommitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() .HasConstraintName("fk_source_branches_source_commits_commit_id"); - b.HasOne("marlin.core.models.VersionControlSource", "Source") + b.HasOne("marlin.web.Models.VersionControlSource", "Source") .WithMany("Branches") .HasForeignKey("SourceId") .OnDelete(DeleteBehavior.Cascade) @@ -381,9 +458,9 @@ namespace marlin.web.Migrations b.Navigation("Source"); }); - modelBuilder.Entity("marlin.core.models.VersionControlledCommit", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledCommit", b => { - b.HasOne("marlin.core.models.VersionControlSource", "Source") + b.HasOne("marlin.web.Models.VersionControlSource", "Source") .WithMany() .HasForeignKey("SourceId") .OnDelete(DeleteBehavior.Cascade) @@ -393,33 +470,40 @@ namespace marlin.web.Migrations b.Navigation("Source"); }); - modelBuilder.Entity("marlin.web.Models.VersionControlSecret", b => + modelBuilder.Entity("marlin.web.Models.WorkflowSnapshot", b => { - b.HasOne("marlin.core.models.VersionControlSource", "Source") - .WithMany() - .HasForeignKey("SourceId") + b.HasOne("marlin.web.Models.VersionControlledCommit", "Commit") + .WithOne("WorkflowSnapshot") + .HasForeignKey("marlin.web.Models.WorkflowSnapshot", "CommitId") .OnDelete(DeleteBehavior.Cascade) .IsRequired() - .HasConstraintName("fk_secrets_sources_source_id"); + .HasConstraintName("fk_workflow_snapshots_source_commits_commit_id"); - b.Navigation("Source"); + b.Navigation("Commit"); }); - modelBuilder.Entity("marlin.core.models.Job", b => + modelBuilder.Entity("marlin.web.Models.Agent", b => + { + b.Navigation("Jobs"); + }); + + modelBuilder.Entity("marlin.web.Models.Job", b => { b.Navigation("StatusUpdates"); }); - modelBuilder.Entity("marlin.core.models.VersionControlSource", b => + modelBuilder.Entity("marlin.web.Models.VersionControlSource", b => { b.Navigation("Branches"); }); - modelBuilder.Entity("marlin.core.models.VersionControlledCommit", b => + modelBuilder.Entity("marlin.web.Models.VersionControlledCommit", b => { b.Navigation("Blobs"); b.Navigation("Branches"); + + b.Navigation("WorkflowSnapshot"); }); #pragma warning restore 612, 618 } -- cgit v1.3.1