From ecd5f5d13936dd097b12766cb95a568ad5b073a9 Mon Sep 17 00:00:00 2001 From: Melodi <62381002+Melodi17@users.noreply.github.com> Date: Tue, 27 Oct 2026 23:04:59 +1000 Subject: feat: lots of stuff --- .../Migrations/20261027095603_AddLogEvent.cs | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/marlin.web/Migrations/20261027095603_AddLogEvent.cs (limited to 'src/marlin.web/Migrations/20261027095603_AddLogEvent.cs') diff --git a/src/marlin.web/Migrations/20261027095603_AddLogEvent.cs b/src/marlin.web/Migrations/20261027095603_AddLogEvent.cs new file mode 100644 index 0000000..b32f68e --- /dev/null +++ b/src/marlin.web/Migrations/20261027095603_AddLogEvent.cs @@ -0,0 +1,67 @@ +using System; +using Microsoft.EntityFrameworkCore.Migrations; + +#nullable disable + +namespace marlin.web.Migrations +{ + /// + public partial class AddLogEvent : Migration + { + /// + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn( + name: "main_branch", + table: "sources", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.CreateTable( + name: "logs", + columns: table => new + { + id = table.Column(type: "uuid", nullable: false), + job_id = table.Column(type: "uuid", nullable: false), + at = table.Column(type: "timestamp with time zone", nullable: false), + message = table.Column(type: "text", nullable: false), + error = table.Column(type: "boolean", nullable: false), + step_id = table.Column(type: "text", nullable: false) + }, + constraints: table => + { + table.PrimaryKey("pk_logs", x => x.id); + table.ForeignKey( + name: "fk_logs_jobs_job_id", + column: x => x.job_id, + principalTable: "jobs", + principalColumn: "id", + onDelete: ReferentialAction.Cascade); + }); + + migrationBuilder.CreateIndex( + name: "ix_logs_job_id", + table: "logs", + column: "job_id"); + } + + /// + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "logs"); + + migrationBuilder.AlterColumn( + name: "main_branch", + table: "sources", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + } + } +} -- cgit v1.3.1