mirror of
https://github.com/bitwarden/server.git
synced 2025-06-30 07:36:14 -05:00
[PM-14590] Modify Notification database table (#5361)
* Added notification type enum Added option type to entity * created migration files * made sprocs backward compatible * made sprocs backward compatible * Fixed linting * Altered table to require an optional taskId * formatted code * Added foreignkey * Formatted code * fixed order
This commit is contained in:
@ -0,0 +1,48 @@
|
||||
using Microsoft.EntityFrameworkCore.Migrations;
|
||||
|
||||
#nullable disable
|
||||
|
||||
namespace Bit.MySqlMigrations.Migrations;
|
||||
|
||||
/// <inheritdoc />
|
||||
public partial class AddOptionalNotifificationTaskId : Migration
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override void Up(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.AddColumn<Guid>(
|
||||
name: "TaskId",
|
||||
table: "Notification",
|
||||
type: "char(36)",
|
||||
nullable: true,
|
||||
collation: "ascii_general_ci");
|
||||
|
||||
migrationBuilder.CreateIndex(
|
||||
name: "IX_Notification_TaskId",
|
||||
table: "Notification",
|
||||
column: "TaskId");
|
||||
|
||||
migrationBuilder.AddForeignKey(
|
||||
name: "FK_Notification_SecurityTask_TaskId",
|
||||
table: "Notification",
|
||||
column: "TaskId",
|
||||
principalTable: "SecurityTask",
|
||||
principalColumn: "Id");
|
||||
}
|
||||
|
||||
/// <inheritdoc />
|
||||
protected override void Down(MigrationBuilder migrationBuilder)
|
||||
{
|
||||
migrationBuilder.DropForeignKey(
|
||||
name: "FK_Notification_SecurityTask_TaskId",
|
||||
table: "Notification");
|
||||
|
||||
migrationBuilder.DropIndex(
|
||||
name: "IX_Notification_TaskId",
|
||||
table: "Notification");
|
||||
|
||||
migrationBuilder.DropColumn(
|
||||
name: "TaskId",
|
||||
table: "Notification");
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user