using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace marlin.web.Migrations
{
///
public partial class AddSecretModel : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "access_secret_id",
table: "sources",
type: "uuid",
nullable: true);
migrationBuilder.CreateTable(
name: "secrets",
columns: table => new
{
id = table.Column(type: "uuid", nullable: false),
source_id = table.Column(type: "uuid", nullable: false),
may_reveal = table.Column(type: "boolean", nullable: false),
kind = table.Column(type: "text", nullable: true),
label = table.Column(type: "text", nullable: false),
content = table.Column(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");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "secrets");
migrationBuilder.DropColumn(
name: "access_secret_id",
table: "sources");
}
}
}