40
41
42
43
44
45
46
47
48
49
50
51
52
53
|
DROP TABLE IF EXISTS archives;
DROP TABLE IF EXISTS session_vars;
DROP TABLE IF EXISTS sessions;
DROP TABLE IF EXISTS tags;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS webviews;
DROP TABLE IF EXISTS area_tags;
DROP TABLE IF EXISTS users_webviews;
DROP TABLE IF EXISTS base_paths;
DROP TABLE IF EXISTS area_owners;
DROP TABLE IF EXISTS shared_user_views;
DROP TABLE IF EXISTS cctrl_info;
DROP TABLE IF EXISTS cctrl_config;
DROP TABLE IF EXISTS platforms;
|
>
|
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
|
DROP TABLE IF EXISTS archives;
DROP TABLE IF EXISTS session_vars;
DROP TABLE IF EXISTS sessions;
DROP TABLE IF EXISTS tags;
DROP TABLE IF EXISTS users;
DROP TABLE IF EXISTS webviews;
DROP TABLE IF EXISTS area_tags;
DROP TABLE IF EXISTS run_tags;
DROP TABLE IF EXISTS users_webviews;
DROP TABLE IF EXISTS base_paths;
DROP TABLE IF EXISTS area_owners;
DROP TABLE IF EXISTS shared_user_views;
DROP TABLE IF EXISTS cctrl_info;
DROP TABLE IF EXISTS cctrl_config;
DROP TABLE IF EXISTS platforms;
|
78
79
80
81
82
83
84
85
86
87
88
89
90
91
|
CONSTRAINT tagconstraint UNIQUE (tag_name));
CREATE TABLE IF NOT EXISTS area_tags (
id SERIAL PRIMARY KEY,
tag_id INTEGER DEFAULT 0,
area_id INTEGER DEFAULT 0,
CONSTRAINT areatagconstraint UNIQUE (tag_id, area_id));
CREATE VIEW area_tag_view as
select a.id as aid, t.id as tid,area_name,tag_name,area_path from areas as a inner join area_tags as at on at.area_id = a.id
inner join tags as t on t.id = at.tag_id ;
INSERT INTO areas (id,area_name,area_path) VALUES (0,'local','.');
|
>
>
>
>
>
>
>
|
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
|
CONSTRAINT tagconstraint UNIQUE (tag_name));
CREATE TABLE IF NOT EXISTS area_tags (
id SERIAL PRIMARY KEY,
tag_id INTEGER DEFAULT 0,
area_id INTEGER DEFAULT 0,
CONSTRAINT areatagconstraint UNIQUE (tag_id, area_id));
CREATE TABLE IF NOT EXISTS run_tags (
id SERIAL PRIMARY KEY,
tag_id INTEGER DEFAULT 0,
run_id INTEGER DEFAULT 0,
CONSTRAINT areatagconstraint UNIQUE (tag_id, run_id));
CREATE VIEW area_tag_view as
select a.id as aid, t.id as tid,area_name,tag_name,area_path from areas as a inner join area_tags as at on at.area_id = a.id
inner join tags as t on t.id = at.tag_id ;
INSERT INTO areas (id,area_name,area_path) VALUES (0,'local','.');
|