Skip to content

Commit

Permalink
switches to use uuid_generate_v4 instead of random function
Browse files Browse the repository at this point in the history
  • Loading branch information
runeanielsen committed Sep 5, 2020
1 parent 4d423c9 commit 386e423
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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;

----------------------------------------------------------------------------------
Expand All @@ -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),
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit 386e423

Please sign in to comment.