summaryrefslogtreecommitdiff
path: root/src/marlin.web/Migrations/20261027095603_AddLogEvent.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/marlin.web/Migrations/20261027095603_AddLogEvent.cs')
-rw-r--r--src/marlin.web/Migrations/20261027095603_AddLogEvent.cs67
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);
+ }
+ }
+}