DamageAssessment_Backend/DamageAssesmentApi/DamageAssesment.Api.Locations/Migrations/20230927211146_AzureLocations.cs
2023-09-27 17:18:48 -04:00

56 lines
2.1 KiB
C#

using Microsoft.EntityFrameworkCore.Migrations;
#nullable disable
namespace DamageAssesment.Api.Locations.Migrations
{
/// <inheritdoc />
public partial class AzureLocations : Migration
{
/// <inheritdoc />
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "Locations",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
RegionId = table.Column<int>(type: "int", nullable: false),
LocationCode = 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(4)", maxLength: 4, nullable: false),
SchoolType = table.Column<string>(type: "nvarchar(2)", maxLength: 2, nullable: false)
},
constraints: table =>
{
table.PrimaryKey("PK_Locations", x => x.Id);
});
migrationBuilder.CreateTable(
name: "Regions",
columns: table => new
{
Id = table.Column<int>(type: "int", nullable: false)
.Annotation("SqlServer:Identity", "1, 1"),
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");
}
}
}