using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Bit.PostgresMigrations.Migrations;
///
public partial class AddSecretAccessPolicies : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "GrantedSecretId",
table: "AccessPolicy",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_AccessPolicy_GrantedSecretId",
table: "AccessPolicy",
column: "GrantedSecretId");
migrationBuilder.AddForeignKey(
name: "FK_AccessPolicy_Secret_GrantedSecretId",
table: "AccessPolicy",
column: "GrantedSecretId",
principalTable: "Secret",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AccessPolicy_Secret_GrantedSecretId",
table: "AccessPolicy");
migrationBuilder.DropIndex(
name: "IX_AccessPolicy_GrantedSecretId",
table: "AccessPolicy");
migrationBuilder.DropColumn(
name: "GrantedSecretId",
table: "AccessPolicy");
}
}