-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathschema.sql
More file actions
60 lines (60 loc) · 1.4 KB
/
schema.sql
File metadata and controls
60 lines (60 loc) · 1.4 KB
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
-- FIXME damnit, is a serial bigint or integer under the hood?
create table users (
id serial primary key,
username varchar(20) not null,
password varchar not null,
realname varchar(80) not null,
UNIQUE(username)
)
---
create table techs (
id serial primary key,
tech varchar not null,
UNIQUE(tech)
)
---
create table user_techs (
id serial primary key,
user_id integer not null,
tech_id integer not null,
UNIQUE(user_id, tech_id)
)
---
create table meetings (
id serial primary key,
meeting_time date not null,
UNIQUE(meeting_time)
)
---
create table projects (
id serial primary key,
user_id integer not null,
name varchar(80) not null,
description text not null,
source_code_url varchar,
UNIQUE(name)
)
---
create table project_techs (
id serial primary key,
project_id integer not null,
tech_id integer not null,
UNIQUE(project_id, tech_id)
)
---
-- "this user is interested in this project"
create table user_projects_interested (
id serial primary key,
user_id integer not null,
project_id integer not null,
-- FIXME integrate later -- don't forget the unique key
--meeting_id integer not null,
UNIQUE(user_id, project_id)
)
---
create table project_meeting_assignment (
id serial primary key,
project_id integer not null,
meeting_id integer not null,
UNIQUE(project_id, meeting_id)
)