using System;
using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DocuMed.Repository.Migrations
{
///
public partial class editUser : Migration
{
///
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.RenameColumn(
name: "Section",
schema: "public",
table: "Users",
newName: "StudentId");
migrationBuilder.AddColumn(
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");
}
///
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");
}
}
}