diff options
| author | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-10-27 23:04:59 +1000 |
|---|---|---|
| committer | Melodi <62381002+Melodi17@users.noreply.github.com> | 2026-10-27 23:04:59 +1000 |
| commit | ecd5f5d13936dd097b12766cb95a568ad5b073a9 (patch) | |
| tree | f360b08e656a98faca4f2b9f10dc44602e6ca289 /src/marlin.web/Migrations/20261027095603_AddLogEvent.cs | |
| parent | 88ee626cb3686dc176cd7911b073c4e65fa54d34 (diff) | |
feat: lots of stuff
Diffstat (limited to 'src/marlin.web/Migrations/20261027095603_AddLogEvent.cs')
| -rw-r--r-- | src/marlin.web/Migrations/20261027095603_AddLogEvent.cs | 67 |
1 files changed, 67 insertions, 0 deletions
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 +{ + /// <inheritdoc /> + public partial class AddLogEvent : Migration + { + /// <inheritdoc /> + protected override void Up(MigrationBuilder migrationBuilder) + { + migrationBuilder.AlterColumn<string>( + name: "main_branch", + table: "sources", + type: "text", + nullable: true, + oldClrType: typeof(string), + oldType: "text"); + + migrationBuilder.CreateTable( + name: "logs", + columns: table => new + { + id = table.Column<Guid>(type: "uuid", nullable: false), + job_id = table.Column<Guid>(type: "uuid", nullable: false), + at = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), + message = table.Column<string>(type: "text", nullable: false), + error = table.Column<bool>(type: "boolean", nullable: false), + step_id = table.Column<string>(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"); + } + + /// <inheritdoc /> + protected override void Down(MigrationBuilder migrationBuilder) + { + migrationBuilder.DropTable( + name: "logs"); + + migrationBuilder.AlterColumn<string>( + name: "main_branch", + table: "sources", + type: "text", + nullable: false, + defaultValue: "", + oldClrType: typeof(string), + oldType: "text", + oldNullable: true); + } + } +} |
