using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace Foxchat.Identity.Migrations
{
///
public partial class AddRedirectUris : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens");
migrationBuilder.AlterColumn(
name: "account_id",
table: "tokens",
type: "uuid",
nullable: true,
oldClrType: typeof(Guid),
oldType: "uuid");
migrationBuilder.AddColumn(
name: "redirect_uris",
table: "applications",
type: "text[]",
nullable: false,
defaultValue: new string[0]);
migrationBuilder.AddForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens",
column: "account_id",
principalTable: "accounts",
principalColumn: "id");
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens");
migrationBuilder.DropColumn(
name: "redirect_uris",
table: "applications");
migrationBuilder.AlterColumn(
name: "account_id",
table: "tokens",
type: "uuid",
nullable: false,
defaultValue: new Guid("00000000-0000-0000-0000-000000000000"),
oldClrType: typeof(Guid),
oldType: "uuid",
oldNullable: true);
migrationBuilder.AddForeignKey(
name: "fk_tokens_accounts_account_id",
table: "tokens",
column: "account_id",
principalTable: "accounts",
principalColumn: "id",
onDelete: ReferentialAction.Cascade);
}
}
}