From 386e423892e9536c6b891e1300962d3933203590 Mon Sep 17 00:00:00 2001 From: Rune Nielsen Date: Sat, 5 Sep 2020 13:41:24 +0200 Subject: [PATCH] switches to use uuid_generate_v4 instead of random function --- .../Scripts/create_route_network_schema.sql | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/OpenFTTH.GDBIntegrator.GeoDatabase/Postgres/SchemaMigration/Scripts/create_route_network_schema.sql b/src/OpenFTTH.GDBIntegrator.GeoDatabase/Postgres/SchemaMigration/Scripts/create_route_network_schema.sql index 14073b3..bf8952e 100644 --- a/src/OpenFTTH.GDBIntegrator.GeoDatabase/Postgres/SchemaMigration/Scripts/create_route_network_schema.sql +++ b/src/OpenFTTH.GDBIntegrator.GeoDatabase/Postgres/SchemaMigration/Scripts/create_route_network_schema.sql @@ -8,6 +8,9 @@ -- Enable PostGIS on database if not already enabled CREATE EXTENSION IF NOT EXISTS postgis; +-- Enable UUID-OSSP +CREATE EXTENSION IF NOT EXISTS "uuid-ossp"; + CREATE SCHEMA IF NOT EXISTS route_network; ---------------------------------------------------------------------------------- @@ -17,7 +20,7 @@ CREATE SCHEMA IF NOT EXISTS route_network; -- Create the route node table CREATE TABLE route_network.route_node ( - mrid uuid DEFAULT uuid_in((md5((random())::text))::cstring), + mrid uuid DEFAULT uuid_generate_v4() NOT NULL, coord geometry(Point,25832), node_name varchar(255), node_kind varchar(255), @@ -72,7 +75,7 @@ FOR EACH ROW EXECUTE PROCEDURE route_network.route_node_update(); -- Create the route segment table CREATE TABLE route_network.route_segment ( - mrid uuid DEFAULT uuid_in((md5((random())::text))::cstring), + mrid uuid DEFAULT uuid_generate_v4() NOT NULL, coord geometry(Linestring,25832), marked_to_be_deleted boolean, delete_me boolean,