summaryrefslogtreecommitdiff
path: root/graphs/sql/daily_gazette/req03.sql
blob: f0173c86f161dc9f2b045612e72351841dd7abee (plain)
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
CREATE TYPE rr_times.rubric_theme AS ENUM
(
    'TECHNOLOGY',
    'ECONOMY',
    'HEALTH',
    'SPORT',
    'CULTURE',
    'POLITICS',
    'SCIENCE',
    'TRAVEL',
    'SOCIETY',
    'ENVIRONMENT',
    'EDUCATION',
    'MEDIA',
    'FASHION',
    'ARCHITECTURE',
    'BUSINESS',
    'SPACE'
);
CREATE TABLE rr_times.rubrics
(
    id SERIAL UNIQUE NOT NULL,
    theme rr_times.rubric_theme NOT NULL,
    nb_columns INTEGER NOT NULL,
    issue_id INTEGER NOT NULL,
    FOREIGN KEY (issue_id) REFERENCES rr_times.issues (id) ON DELETE CASCADE,
    PRIMARY KEY (id, theme, issue_id)
);