Api-PWA/DocuMed.Repository/Migrations/20231021122606_editUser.cs

69 lines
2.0 KiB
C#

using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DocuMed.Repository.Migrations
{
/// <inheritdoc />
public partial class editUser : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Section",
schema: "public",
table: "Users",
newName: "StudentId");
migrationBuilder.AddColumn<Guid>(
name: "SectionId",
schema: "public",
table: "Users",
type: "uuid",
nullable: true);
migrationBuilder.CreateIndex(
name: "IX_Users_SectionId",
schema: "public",
table: "Users",
column: "SectionId");
migrationBuilder.AddForeignKey(
name: "FK_Users_Sections_SectionId",
schema: "public",
table: "Users",
column: "SectionId",
principalSchema: "public",
principalTable: "Sections",
principalColumn: "Id");
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropForeignKey(
name: "FK_Users_Sections_SectionId",
schema: "public",
table: "Users");
migrationBuilder.DropIndex(
name: "IX_Users_SectionId",
schema: "public",
table: "Users");
migrationBuilder.DropColumn(
name: "SectionId",
schema: "public",
table: "Users");
migrationBuilder.RenameColumn(
name: "StudentId",
schema: "public",
table: "Users",
newName: "Section");
}
}
}