Add table for sub region type
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
|
create type region_type as enum ('NONE', 'DMA', 'SA', 'VD', 'WDA');
|
||||||
|
|
||||||
create table region
|
create table region
|
||||||
(
|
(
|
||||||
id text primary key
|
id text primary key
|
||||||
|
, r_type region_type not null default 'NONE'
|
||||||
, boundary geometry not null unique
|
, boundary geometry not null unique
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
5
script/sql/create/33.dma.sql
Normal file
5
script/sql/create/33.dma.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
create table region_dma
|
||||||
|
(
|
||||||
|
id text primary key references region(id)
|
||||||
|
, parent text references region_dma(id)
|
||||||
|
);
|
||||||
6
script/sql/create/34.sa.sql
Normal file
6
script/sql/create/34.sa.sql
Normal file
@@ -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
|
||||||
|
);
|
||||||
5
script/sql/create/35.vd.sql
Normal file
5
script/sql/create/35.vd.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
create table region_vd
|
||||||
|
(
|
||||||
|
id text primary key references region(id)
|
||||||
|
, source varchar(32) not null -- references _node(id)
|
||||||
|
);
|
||||||
5
script/sql/create/36.wda.sql
Normal file
5
script/sql/create/36.wda.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
create table region_wda
|
||||||
|
(
|
||||||
|
id text primary key references region(id)
|
||||||
|
, demand float8 not null default 0.0
|
||||||
|
);
|
||||||
@@ -11,3 +11,5 @@ drop table if exists temp_region;
|
|||||||
drop index if exists region_gist;
|
drop index if exists region_gist;
|
||||||
|
|
||||||
drop table if exists region;
|
drop table if exists region;
|
||||||
|
|
||||||
|
drop type if exists region_type;
|
||||||
|
|||||||
1
script/sql/drop/33.dma.sql
Normal file
1
script/sql/drop/33.dma.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
drop table if exists region_dma;
|
||||||
1
script/sql/drop/34.sa.sql
Normal file
1
script/sql/drop/34.sa.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
drop table if exists region_sa;
|
||||||
1
script/sql/drop/35.vd.sql
Normal file
1
script/sql/drop/35.vd.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
drop table if exists region_vd;
|
||||||
1
script/sql/drop/36.wda.sql
Normal file
1
script/sql/drop/36.wda.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
drop table if exists region_wda;
|
||||||
Reference in New Issue
Block a user