DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Locations/Migrations/20230817214454_InitialLocation.cs
2023-08-18 17:14:41 -04:00

53 lines
2.0 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DamageAssesment.Api.Locations.Migrations
{
/// <inheritdoc />
public partial class InitialLocation : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Locations",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(4)", maxLength: 4, nullable: false),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
MaintenanceCenter = table.Column<string>(type: "nvarchar(1)", maxLength: 1, nullable: false),
SchoolType = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false),
RegionId = table.Column<string>(type: "nvarchar(max)", nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Locations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Regions",
columns: table => new
{
Id = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false),
Name = table.Column<string>(type: "nvarchar(50)", maxLength: 50, nullable: false),
Abbreviation = table.Column<string>(type: "nvarchar(5)", maxLength: 5, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Regions", x => x.Id);
});
}
/// <inheritdoc />
protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "Locations");
migrationBuilder.DropTable(
name: "Regions");
}
}
}