59 lines
2.4 KiB
C#
59 lines
2.4 KiB
C#
using System;
|
|
using Microsoft.EntityFrameworkCore.Migrations;
|
|
|
|
#nullable disable
|
|
|
|
namespace DocuMed.Repository.Migrations
|
|
{
|
|
/// <inheritdoc />
|
|
public partial class addSections : Migration
|
|
{
|
|
/// <inheritdoc />
|
|
protected override void Up(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.CreateTable(
|
|
name: "Sections",
|
|
schema: "public",
|
|
columns: table => new
|
|
{
|
|
Id = table.Column<Guid>(type: "uuid", nullable: false),
|
|
Name = table.Column<string>(type: "text", nullable: false),
|
|
Detail = table.Column<string>(type: "text", nullable: false),
|
|
UniversityId = table.Column<Guid>(type: "uuid", nullable: false),
|
|
RemovedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
CreatedBy = table.Column<string>(type: "text", nullable: false),
|
|
IsRemoved = table.Column<bool>(type: "boolean", nullable: false),
|
|
RemovedBy = table.Column<string>(type: "text", nullable: false),
|
|
ModifiedAt = table.Column<DateTime>(type: "timestamp without time zone", nullable: false),
|
|
ModifiedBy = table.Column<string>(type: "text", nullable: false)
|
|
},
|
|
constraints: table =>
|
|
{
|
|
table.PrimaryKey("PK_Sections", x => x.Id);
|
|
table.ForeignKey(
|
|
name: "FK_Sections_Universities_UniversityId",
|
|
column: x => x.UniversityId,
|
|
principalSchema: "public",
|
|
principalTable: "Universities",
|
|
principalColumn: "Id",
|
|
onDelete: ReferentialAction.Restrict);
|
|
});
|
|
|
|
migrationBuilder.CreateIndex(
|
|
name: "IX_Sections_UniversityId",
|
|
schema: "public",
|
|
table: "Sections",
|
|
column: "UniversityId");
|
|
}
|
|
|
|
/// <inheritdoc />
|
|
protected override void Down(MigrationBuilder migrationBuilder)
|
|
{
|
|
migrationBuilder.DropTable(
|
|
name: "Sections",
|
|
schema: "public");
|
|
}
|
|
}
|
|
}
|