Skip to content

Commit

Permalink
add not null contraint for geometry route_node and route_segment
Browse files Browse the repository at this point in the history
  • Loading branch information
runeanielsen committed Mar 10, 2024
1 parent 82b20af commit 5f36255
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
<None Update="Postgres/SchemaMigration/Scripts/ddl_survey_import.sql" CopyToOutputDirectory="PreserveNewest" />
<None Update="Postgres/SchemaMigration/Scripts/update_and_create_trigger_changes.sql" CopyToOutputDirectory="PreserveNewest" />
<None Update="Postgres/SchemaMigration/Scripts/set_valid_geometry_constraint_route_network.sql" CopyToOutputDirectory="PreserveNewest" />
<None Update="Postgres/SchemaMigration/Scripts/set_not_null_contraint_route_network.sql" CopyToOutputDirectory="PreserveNewest" />
</ItemGroup>

</Project>
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.
}
}
}
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;

0 comments on commit 5f36255

Please sign in to comment.