Files
myoffice/MyOffice.Migration.Postgres/Migrations/20230726160638_AccessOwner.cs
T
2023-07-28 21:18:18 +03:00

50 lines
1.4 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace MyOffice.Migrations.Postgres.Migrations
{
/// <inheritdoc />
public partial class AccessOwner : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.AddColumn<Guid>(
name: "OwnerId",
table: "AccountAccesses",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_AccountAccesses_OwnerId",
table: "AccountAccesses",
column: "OwnerId");
migrationBuilder.AddForeignKey(
name: "FK_AccountAccesses_Users_OwnerId",
table: "AccountAccesses",
column: "OwnerId",
principalTable: "Users",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_AccountAccesses_Users_OwnerId",
table: "AccountAccesses");
migrationBuilder.DropIndex(
name: "IX_AccountAccesses_OwnerId",
table: "AccountAccesses");
migrationBuilder.DropColumn(
name: "OwnerId",
table: "AccountAccesses");
}
}
}