summaryrefslogtreecommitdiff
path: root/src/marlin.web/Migrations/20260905102259_AddSecretModel.cs
diff options
context:
space:
mode:
Diffstat (limited to 'src/marlin.web/Migrations/20260905102259_AddSecretModel.cs')
-rw-r--r--src/marlin.web/Migrations/20260905102259_AddSecretModel.cs59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/marlin.web/Migrations/20260905102259_AddSecretModel.cs b/src/marlin.web/Migrations/20260905102259_AddSecretModel.cs
new file mode 100644
index 0000000..8b09e89
--- /dev/null
+++ b/src/marlin.web/Migrations/20260905102259_AddSecretModel.cs
@@ -0,0 +1,59 @@
+using System;
+using Microsoft.EntityFrameworkCore.Migrations;
+
+#nullable disable
+
+namespace marlin.web.Migrations
+{
+ /// <inheritdoc />
+ public partial class AddSecretModel : Migration
+ {
+ /// <inheritdoc />
+ protected override void Up(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.AddColumn<Guid>(
+ name: "access_secret_id",
+ table: "sources",
+ type: "uuid",
+ nullable: true);
+
+ migrationBuilder.CreateTable(
+ name: "secrets",
+ columns: table => new
+ {
+ id = table.Column<Guid>(type: "uuid", nullable: false),
+ source_id = table.Column<Guid>(type: "uuid", nullable: false),
+ may_reveal = table.Column<bool>(type: "boolean", nullable: false),
+ kind = table.Column<string>(type: "text", nullable: true),
+ label = table.Column<string>(type: "text", nullable: false),
+ content = table.Column<string>(type: "text", nullable: false)
+ },
+ constraints: table =>
+ {
+ table.PrimaryKey("pk_secrets", x => x.id);
+ table.ForeignKey(
+ name: "fk_secrets_sources_source_id",
+ column: x => x.source_id,
+ principalTable: "sources",
+ principalColumn: "id",
+ onDelete: ReferentialAction.Cascade);
+ });
+
+ migrationBuilder.CreateIndex(
+ name: "ix_secrets_source_id",
+ table: "secrets",
+ column: "source_id");
+ }
+
+ /// <inheritdoc />
+ protected override void Down(MigrationBuilder migrationBuilder)
+ {
+ migrationBuilder.DropTable(
+ name: "secrets");
+
+ migrationBuilder.DropColumn(
+ name: "access_secret_id",
+ table: "sources");
+ }
+ }
+}