You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
48 lines
1.4 KiB
48 lines
1.4 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
#nullable disable |
|
|
|
namespace Bit.PostgresMigrations.Migrations; |
|
|
|
/// <inheritdoc /> |
|
public partial class AddSecretAccessPolicies : Migration |
|
{ |
|
/// <inheritdoc /> |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.AddColumn<Guid>( |
|
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); |
|
} |
|
|
|
/// <inheritdoc /> |
|
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"); |
|
} |
|
}
|
|
|