annotate artifact-database/doc/schema.sql @ 15:9ad6ec2d09c3

Implemented restoring artifacts from database. artifacts/trunk@30 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Sascha L. Teichmann <sascha.teichmann@intevation.de>
date Mon, 07 Sep 2009 10:06:23 +0000
parents e8626caac353
children
rev   line source
3
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
1 --
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
2 -- schema to store artifacts in H2 databases.
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
3 --
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
4
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
5 BEGIN;
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
6
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
7 -- not using AUTO_INCREMENT to be more compatible with
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
8 -- other dbms.
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
9 CREATE SEQUENCE ARTIFACTS_ID_SEQ;
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
10
3
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
11 CREATE TABLE artifacts (
10
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
12 id INT PRIMARY KEY NOT NULL,
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
13 gid UUID NOT NULL UNIQUE,
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
14 creation TIMESTAMP NOT NULL,
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
15 last_access TIMESTAMP NOT NULL,
e8626caac353 * Made Artifact life cycle symmetric: setup/endOfLife.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 4
diff changeset
16 ttl BIGINT, -- NULL means eternal
4
13a12b607baf Added mechanism to create an share a global context in the artifact database.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents: 3
diff changeset
17 data BINARY
3
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
18 );
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
19
b1ec257e9d8d Added dependencies to H2 and restlet.
Sascha L. Teichmann <sascha.teichmann@intevation.de>
parents:
diff changeset
20 COMMIT;

http://dive4elements.wald.intevation.org