0
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
1 CREATE TABLE projects ( |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
2 id INTEGER PRIMARY KEY AUTOINCREMENT, |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
3 key VARCHAR(16), |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
4 description VARCHAR(256), |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
5 active BOOLEAN DEFAULT 1 |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
6 ); |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
7 |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
8 CREATE TABLE entries ( |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
9 id INTEGER PRIMARY KEY AUTOINCREMENT, |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
10 project_id INTEGER REFERENCES projects(id), |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
11 start_time TIMESTAMP NOT NULL, |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
12 stop_time TIMESTAMP NOT NULL, |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
13 description VARCHAR(256), |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
14 |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
15 CHECK (strftime('%s', start_time) <= strftime('%s', stop_time)) |
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff
changeset
|
16 ); |