diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-13 13:22:20 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-09-13 13:22:20 +1000 |
| commit | df0737e55afeb5c01eb39909605970d1d3a73ffc (patch) | |
| tree | 09823eaa310c60eefd2420dc305acae45c81900f /src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs | |
| parent | ee69ce25b2fba871920260028bb10c2d6b62b26f (diff) | |
refactor: cleanup; feat: connection to agent
Diffstat (limited to 'src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs')
| -rw-r--r-- | src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs b/src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs new file mode 100644 index 0000000..d47ee9e --- /dev/null +++ b/src/marlin.web/Migrations/20260906003038_AddWorkflowSnapshot.cs @@ -0,0 +1,59 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace marlin.web.Migrations +{ + /// <inheritdoc /> + public partial class AddWorkflowSnapshot : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AddColumn<bool>( + name: "workflow_scanned", + table: "source_commits", + type: "boolean", + nullable: false, + defaultValue: false); + + migrationBuilder.CreateTable( + name: "workflow_snapshots", + columns: table => new + { + id = table.Column<Guid>(type: "uuid", nullable: false), + commit_id = table.Column<Guid>(type: "uuid", nullable: false), + scanned_at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + workflow = table.Column<string>(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_workflow_snapshots", x => x.id); + table.ForeignKey( + name: "fk_workflow_snapshots_source_commits_commit_id", + column: x => x.commit_id, + principalTable: "source_commits", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "ix_workflow_snapshots_commit_id", + table: "workflow_snapshots", + column: "commit_id", + unique: true); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "workflow_snapshots"); + + migrationBuilder.DropColumn( + name: "workflow_scanned", + table: "source_commits"); + } + } +} |
