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.
58 lines
2.1 KiB
58 lines
2.1 KiB
using Microsoft.EntityFrameworkCore.Migrations; |
|
|
|
#nullable disable |
|
|
|
namespace Bit.PostgresMigrations.Migrations; |
|
|
|
/// <inheritdoc /> |
|
public partial class SecurityTasks : Migration |
|
{ |
|
/// <inheritdoc /> |
|
protected override void Up(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.CreateTable( |
|
name: "SecurityTask", |
|
columns: table => new |
|
{ |
|
Id = table.Column<Guid>(type: "uuid", nullable: false), |
|
OrganizationId = table.Column<Guid>(type: "uuid", nullable: false), |
|
CipherId = table.Column<Guid>(type: "uuid", nullable: true), |
|
Type = table.Column<byte>(type: "smallint", nullable: false), |
|
Status = table.Column<byte>(type: "smallint", nullable: false), |
|
CreationDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false), |
|
RevisionDate = table.Column<DateTime>(type: "timestamp with time zone", nullable: false) |
|
}, |
|
constraints: table => |
|
{ |
|
table.PrimaryKey("PK_SecurityTask", x => x.Id); |
|
table.ForeignKey( |
|
name: "FK_SecurityTask_Cipher_CipherId", |
|
column: x => x.CipherId, |
|
principalTable: "Cipher", |
|
principalColumn: "Id"); |
|
table.ForeignKey( |
|
name: "FK_SecurityTask_Organization_OrganizationId", |
|
column: x => x.OrganizationId, |
|
principalTable: "Organization", |
|
principalColumn: "Id", |
|
onDelete: ReferentialAction.Cascade); |
|
}); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_SecurityTask_CipherId", |
|
table: "SecurityTask", |
|
column: "CipherId"); |
|
|
|
migrationBuilder.CreateIndex( |
|
name: "IX_SecurityTask_OrganizationId", |
|
table: "SecurityTask", |
|
column: "OrganizationId"); |
|
} |
|
|
|
/// <inheritdoc /> |
|
protected override void Down(MigrationBuilder migrationBuilder) |
|
{ |
|
migrationBuilder.DropTable( |
|
name: "SecurityTask"); |
|
} |
|
}
|
|
|