using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MyOffice.Migrations.Postgres.Migrations
{
///
public partial class usercurrency : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn(
name: "CurrencyId",
table: "Users",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.AddColumn(
name: "Symbol",
table: "CurrencyGlobals",
type: "text",
nullable: false,
defaultValue: "");
migrationBuilder.CreateIndex(
name: "IX_Users_CurrencyId",
table: "Users",
column: "CurrencyId");
migrationBuilder.AddForeignKey(
name: "FK_Users_CurrencyGlobals_CurrencyId",
table: "Users",
column: "CurrencyId",
principalTable: "CurrencyGlobals",
principalColumn: "Id",
onDelete: ReferentialAction.Cascade);
}
///
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Users_CurrencyGlobals_CurrencyId",
table: "Users");
migrationBuilder.DropIndex(
name: "IX_Users_CurrencyId",
table: "Users");
migrationBuilder.DropColumn(
name: "CurrencyId",
table: "Users");
migrationBuilder.DropColumn(
name: "Symbol",
table: "CurrencyGlobals");
}
}
}