-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: switch wms/wfs views V3 GAWR-6685
- Loading branch information
Showing
4 changed files
with
564 additions
and
0 deletions.
There are no files selected for viewing
216 changes: 216 additions & 0 deletions
216
...BuildingRegistry.Projections.Wfs/Migrations/20241128083931_SwitchWmsViewsToV3.Designer.cs
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
56 changes: 56 additions & 0 deletions
56
src/BuildingRegistry.Projections.Wfs/Migrations/20241128083931_SwitchWmsViewsToV3.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,56 @@ | ||
using Microsoft.EntityFrameworkCore.Migrations; | ||
|
||
#nullable disable | ||
|
||
namespace BuildingRegistry.Projections.Wfs.Migrations | ||
{ | ||
using Infrastructure; | ||
|
||
/// <inheritdoc /> | ||
public partial class SwitchWmsViewsToV3 : Migration | ||
{ | ||
private const string BuildingViewName = "GebouwView"; | ||
|
||
/// <inheritdoc /> | ||
protected override void Up(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.Sql($@"DROP VIEW [{Schema.Wfs}].[{BuildingViewName}]"); | ||
|
||
migrationBuilder.Sql($@" | ||
CREATE VIEW [{Schema.Wfs}].[{BuildingViewName}] | ||
WITH SCHEMABINDING | ||
AS | ||
SELECT | ||
[PersistentLocalId] AS [MyId], | ||
[Id], | ||
[PersistentLocalId] AS [ObjectId], | ||
[VersionAsString] AS [VersieId], | ||
[Geometry] AS [Geometrie], | ||
[GeometryMethod] AS [GeometrieMethode], | ||
[Status] AS [GebouwStatus] | ||
FROM [{Schema.Wfs}].[{BuildingV3.BuildingConfiguration.TableName}] | ||
WHERE [IsRemoved] = 0 and Geometry is not null"); | ||
} | ||
|
||
/// <inheritdoc /> | ||
protected override void Down(MigrationBuilder migrationBuilder) | ||
{ | ||
migrationBuilder.Sql($@"DROP VIEW [{Schema.Wfs}].[{BuildingViewName}]"); | ||
|
||
migrationBuilder.Sql($@" | ||
CREATE VIEW [{Schema.Wfs}].[{BuildingViewName}] | ||
WITH SCHEMABINDING | ||
AS | ||
SELECT | ||
[PersistentLocalId] AS [MyId], | ||
[Id], | ||
[PersistentLocalId] AS [ObjectId], | ||
[VersionAsString] AS [VersieId], | ||
[Geometry] AS [Geometrie], | ||
[GeometryMethod] AS [GeometrieMethode], | ||
[Status] AS [GebouwStatus] | ||
FROM [{Schema.Wfs}].[{BuildingV2.BuildingConfiguration.TableName}] | ||
WHERE [IsRemoved] = 0 and Geometry is not null"); | ||
} | ||
} | ||
} |
Oops, something went wrong.