-
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.
add not null contraint for geometry route_node and route_segment
- Loading branch information
1 parent
82b20af
commit 5f36255
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
...oDatabase/Postgres/SchemaMigration/1710077940_AddConstraintNotNullGeometryRouteNetwork.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(1710077940)] | ||
public class AddConstraintNotNullGeometryRouteNetwork : Migration | ||
{ | ||
public override void Up() | ||
{ | ||
Execute.Script(Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().Location) | ||
+ "/Postgres/SchemaMigration/Scripts/set_not_null_contraint_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
...tor.GeoDatabase/Postgres/SchemaMigration/Scripts/set_not_null_contraint_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 ALTER COLUMN coord SET NOT NULL; | ||
ALTER TABLE route_network.route_segment ALTER COLUMN coord SET NOT NULL; |