-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
sets constraint is simple for route network geometry field (#120)
- Loading branch information
1 parent
d2d10aa
commit 4733785
Showing
3 changed files
with
23 additions
and
0 deletions.
There are no files selected for viewing
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
20 changes: 20 additions & 0 deletions
20
...Database/Postgres/SchemaMigration/1710080321_AddConstraintIsSimpleGeometryRouteNetwork.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,20 @@ | ||
using FluentMigrator; | ||
using System.IO; | ||
|
||
namespace OpenFTTH.GDBIntegrator.GeoDatabase.Postgres.SchemaMigration | ||
{ | ||
[Migration(1710080321)] | ||
public class AddConstraintIsSimpleGeometryRouteNetwork : Migration | ||
{ | ||
public override void Up() | ||
{ | ||
Execute.Script(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) | ||
+ "/Postgres/SchemaMigration/Scripts/set_constraint_is_simple_route_network.sql"); | ||
} | ||
|
||
public override void Down() | ||
{ | ||
// This is a hard change to do and needs to be resolved manually if a down is needed to be done. | ||
} | ||
} | ||
} |
2 changes: 2 additions & 0 deletions
2
...r.GeoDatabase/Postgres/SchemaMigration/Scripts/set_constraint_is_simple_route_network.sql
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,2 @@ | ||
ALTER TABLE route_network.route_node ADD CONSTRAINT CHECK_IS_SIMPLE_GEOMETRY CHECK (st_issimple(coord)); | ||
ALTER TABLE route_network.route_segment ADD CONSTRAINT CHECK_IS_SIMPLE_GEOMETRY CHECK (st_issimple(coord)); |