-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Add AddressWmsItemV2 EF migration
- Loading branch information
Showing
3 changed files
with
453 additions
and
0 deletions.
There are no files selected for viewing
294 changes: 294 additions & 0 deletions
294
...ddressRegistry.Projections.Wms/Migrations/20240109153142_Add_AddressWmsItemV2.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
77 changes: 77 additions & 0 deletions
77
src/AddressRegistry.Projections.Wms/Migrations/20240109153142_Add_AddressWmsItemV2.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
} | ||
} | ||
} |
Oops, something went wrong.