Skip to content

Commit

Permalink
fix: Add AddressWmsItemV2 EF migration
Browse files Browse the repository at this point in the history
  • Loading branch information
jvandaal committed Jan 9, 2024
1 parent 4e07761 commit c02822c
Show file tree
Hide file tree
Showing 3 changed files with 453 additions and 0 deletions.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
using System;
using Microsoft.EntityFrameworkCore.Migrations;
using NetTopologySuite.Geometries;

#nullable disable

namespace AddressRegistry.Projections.Wms.Migrations
{
public partial class Add_AddressWmsItemV2 : Migration
{
protected override void Up(MigrationBuilder migrationBuilder)
{
migrationBuilder.CreateTable(
name: "AddressWmsV2",
schema: "wms.address",
columns: table => new
{
AddressPersistentLocalId = table.Column<int>(type: "int", nullable: false),
ParentAddressPersistentLocalId = table.Column<int>(type: "int", nullable: true),
StreetNamePersistentLocalId = table.Column<int>(type: "int", nullable: false),
PostalCode = table.Column<string>(type: "nvarchar(max)", nullable: true),
HouseNumber = table.Column<string>(type: "nvarchar(max)", nullable: false),
HouseNumberLabel = table.Column<string>(type: "nvarchar(max)", nullable: true),
HouseNumberLabelLength = table.Column<int>(type: "int", nullable: true),
LabelType = table.Column<int>(type: "int", nullable: false),
BoxNumber = table.Column<string>(type: "nvarchar(max)", nullable: true),
Status = table.Column<string>(type: "nvarchar(450)", nullable: false),
OfficiallyAssigned = table.Column<bool>(type: "bit", nullable: false),
Position = table.Column<Point>(type: "sys.geometry", nullable: false),
PositionX = table.Column<double>(type: "float", nullable: false),
PositionY = table.Column<double>(type: "float", nullable: false),
PositionMethod = table.Column<string>(type: "nvarchar(max)", nullable: false),
PositionSpecification = table.Column<string>(type: "nvarchar(max)", nullable: false),
Removed = table.Column<bool>(type: "bit", nullable: false),
VersionTimestamp = table.Column<DateTimeOffset>(type: "datetimeoffset", nullable: false),
VersionAsString = table.Column<string>(type: "nvarchar(max)", nullable: true)
},
constraints: table =>
{
table.PrimaryKey("PK_AddressWmsV2", x => x.AddressPersistentLocalId)
.Annotation("SqlServer:Clustered", true);
});

migrationBuilder.CreateIndex(
name: "IX_AddressWmsV2_ParentAddressPersistentLocalId",
schema: "wms.address",
table: "AddressWmsV2",
column: "ParentAddressPersistentLocalId");

migrationBuilder.CreateIndex(
name: "IX_AddressWmsV2_PositionX_PositionY_Removed_Status",
schema: "wms.address",
table: "AddressWmsV2",
columns: new[] { "PositionX", "PositionY", "Removed", "Status" })
.Annotation("SqlServer:Include", new[] { "StreetNamePersistentLocalId" });

migrationBuilder.CreateIndex(
name: "IX_AddressWmsV2_Status",
schema: "wms.address",
table: "AddressWmsV2",
column: "Status");

migrationBuilder.CreateIndex(
name: "IX_AddressWmsV2_StreetNamePersistentLocalId",
schema: "wms.address",
table: "AddressWmsV2",
column: "StreetNamePersistentLocalId");
}

protected override void Down(MigrationBuilder migrationBuilder)
{
migrationBuilder.DropTable(
name: "AddressWmsV2",
schema: "wms.address");
}
}
}
Loading

0 comments on commit c02822c

Please sign in to comment.