diff --git a/script/sql/create/32.region.sql b/script/sql/create/32.region.sql index b4ec745..9b59a10 100644 --- a/script/sql/create/32.region.sql +++ b/script/sql/create/32.region.sql @@ -1,6 +1,9 @@ +create type region_type as enum ('NONE', 'DMA', 'SA', 'VD', 'WDA'); + create table region ( id text primary key +, r_type region_type not null default 'NONE' , boundary geometry not null unique ); diff --git a/script/sql/create/33.dma.sql b/script/sql/create/33.dma.sql new file mode 100644 index 0000000..85df39a --- /dev/null +++ b/script/sql/create/33.dma.sql @@ -0,0 +1,5 @@ +create table region_dma +( + id text primary key references region(id) +, parent text references region_dma(id) +); diff --git a/script/sql/create/34.sa.sql b/script/sql/create/34.sa.sql new file mode 100644 index 0000000..5e9a4dc --- /dev/null +++ b/script/sql/create/34.sa.sql @@ -0,0 +1,6 @@ +create table region_sa +( + id text primary key references region(id) +, source varchar(32) not null -- references _node(id) +, time_index integer not null +); diff --git a/script/sql/create/35.vd.sql b/script/sql/create/35.vd.sql new file mode 100644 index 0000000..7878151 --- /dev/null +++ b/script/sql/create/35.vd.sql @@ -0,0 +1,5 @@ +create table region_vd +( + id text primary key references region(id) +, source varchar(32) not null -- references _node(id) +); diff --git a/script/sql/create/36.wda.sql b/script/sql/create/36.wda.sql new file mode 100644 index 0000000..6492d1a --- /dev/null +++ b/script/sql/create/36.wda.sql @@ -0,0 +1,5 @@ +create table region_wda +( + id text primary key references region(id) +, demand float8 not null default 0.0 +); diff --git a/script/sql/drop/32.region.sql b/script/sql/drop/32.region.sql index 693aa07..9b38883 100644 --- a/script/sql/drop/32.region.sql +++ b/script/sql/drop/32.region.sql @@ -11,3 +11,5 @@ drop table if exists temp_region; drop index if exists region_gist; drop table if exists region; + +drop type if exists region_type; diff --git a/script/sql/drop/33.dma.sql b/script/sql/drop/33.dma.sql new file mode 100644 index 0000000..04469bb --- /dev/null +++ b/script/sql/drop/33.dma.sql @@ -0,0 +1 @@ +drop table if exists region_dma; diff --git a/script/sql/drop/34.sa.sql b/script/sql/drop/34.sa.sql new file mode 100644 index 0000000..ab8d9a7 --- /dev/null +++ b/script/sql/drop/34.sa.sql @@ -0,0 +1 @@ +drop table if exists region_sa; diff --git a/script/sql/drop/35.vd.sql b/script/sql/drop/35.vd.sql new file mode 100644 index 0000000..bc87202 --- /dev/null +++ b/script/sql/drop/35.vd.sql @@ -0,0 +1 @@ +drop table if exists region_vd; diff --git a/script/sql/drop/36.wda.sql b/script/sql/drop/36.wda.sql new file mode 100644 index 0000000..119650d --- /dev/null +++ b/script/sql/drop/36.wda.sql @@ -0,0 +1 @@ +drop table if exists region_wda;