-
Notifications
You must be signed in to change notification settings - Fork 0
/
CreateTables_R2.sql
38 lines (34 loc) · 1.7 KB
/
CreateTables_R2.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
ALTER TABLE network.base_centreline
ADD COLUMN shape_length numeric(38, 3);
--drop table network.DMN_PLAN_TYPE_EXT;
CREATE TABLE network.DMN_PLAN_TYPE_EXT
(EXT_NAME varchar(12) NOT NULL ,
EXT_TYPE varchar(6) NOT NULL ,
DESCRIPTION varchar(500) NOT NULL ,
PLAN_TYPE varchar(50) NOT NULL ,
SORT_SEQUENCE numeric(7,2) NOT NULL ,
BIZ_EFFECTIVE_DATE timestamp NOT NULL ,
BIZ_EXPIRY_DATE timestamp NOT NULL ,
TRANS_ID_CREATE numeric(12,0) NOT NULL ,
TRANS_ID_EXPIRE numeric(12,0) NOT NULL ,
CONSTRAINT DMN_PLAN_TYPE_EXT_FK FOREIGN KEY (PLAN_TYPE)
REFERENCES network.DMN_PLAN_TYPE (PLAN_TYPE)
);
GRANT ALL ON TABLE network.DMN_PLAN_TYPE_EXT TO network;
GRANT INSERT, SELECT, UPDATE, DELETE ON TABLE network.DMN_PLAN_TYPE_EXT TO sde;
CREATE TABLE network.DMN_CONTROL_TASK_TYPE
( CONTROL_TASK_TYPE varchar(30) NOT NULL primary key,
DESCRIPTION varchar(500) NOT NULL ,
SORT_SEQUENCE numeric(5,2) NOT NULL ,
BIZ_EFFECTIVE_DATE timestamp NOT NULL ,
BIZ_EXPIRY_DATE timestamp NOT NULL ,
TRANS_ID_CREATE numeric(12,0) NOT NULL ,
TRANS_ID_EXPIRE numeric(12,0) NOT NULL
);
CREATE UNIQUE INDEX DMN_CONTROL_TASK_TYPE_PK ON network.DMN_CONTROL_TASK_TYPE (CONTROL_TASK_TYPE);
GRANT ALL ON TABLE network.DMN_CONTROL_TASK_TYPE TO network;
GRANT INSERT, SELECT, UPDATE, DELETE ON TABLE network.DMN_CONTROL_TASK_TYPE TO sde;
--insert into DMN_CONTROL_TASK_TYPE values ('PARCEL', 'Cadastral', 1, current_timestamp, '3000-01-01 00:00:00'::timestamp, 1, -1);
--insert into DMN_CONTROL_TASK_TYPE values ('STREET/ADDRESS', 'Centreline/Address', 2, current_timestamp, '3000-01-01 00:00:00'::timestamp, 1, -1);
select * from DMN_CONTROL_TASK_TYPE;
-----------------------------------------------------------