1 | -------------------------------------------------------------------------------- |
---|
2 | -- |
---|
3 | -- PostgreSQL definition of tables required byt the ZOO-Kernel version >= 1.5.0 |
---|
4 | -- if the the db-backend option is activated |
---|
5 | -- |
---|
6 | -- Copyright (C) 2015 GeoLabs SARL. All rights reserved. |
---|
7 | -- Author: David Saggiorato <david.saggiorato@geolabs.fr> |
---|
8 | -- |
---|
9 | -- Permission is hereby granted, free of charge, to any person obtaining a copy |
---|
10 | -- of this software and associated documentation files (the "Software"), to deal |
---|
11 | -- in the Software without restriction, including without limitation the rights |
---|
12 | -- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
---|
13 | -- copies of the Software, and to permit persons to whom the Software is |
---|
14 | -- furnished to do so, subject to the following conditions: |
---|
15 | -- |
---|
16 | -- The above copyright notice and this permission notice shall be included in |
---|
17 | -- all copies or substantial portions of the Software. |
---|
18 | -- |
---|
19 | -- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
---|
20 | -- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
---|
21 | -- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
---|
22 | -- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
---|
23 | -- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
---|
24 | -- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
---|
25 | -- THE SOFTWARE. |
---|
26 | -- |
---|
27 | -------------------------------------------------------------------------------- |
---|
28 | -- If your database is not using UTF-8 per default then uncomment the following |
---|
29 | -- SET client_encoding = 'UTF8'; |
---|
30 | -------------------------------------------------------------------------------- |
---|
31 | -- Create a dedicated schema to store all tables |
---|
32 | -- Uncomment the following 2 lines to activate the schema use |
---|
33 | -- CREATE SCHEMA processdb; |
---|
34 | -- SET search_path TO processdb; |
---|
35 | -------------------------------------------------------------------------------- |
---|
36 | -- Services table |
---|
37 | -- Used to store information about services running asynchronously |
---|
38 | create table services ( |
---|
39 | osid TEXT unique, |
---|
40 | sid TEXT unique, |
---|
41 | uuid TEXT unique, |
---|
42 | fstate varchar(25), |
---|
43 | status TEXT, |
---|
44 | response TEXT, |
---|
45 | creation_time timestamp with time zone default now(), |
---|
46 | end_time timestamp with time zone default NULL, |
---|
47 | progress int, |
---|
48 | message TEXT |
---|
49 | ); |
---|
50 | -------------------------------------------------------------------------------- |
---|
51 | -- Responses table |
---|
52 | -- Used to store the response provided by a services running asynchronously |
---|
53 | create table responses ( |
---|
54 | uuid text references services(uuid) ON DELETE CASCADE, |
---|
55 | content text, |
---|
56 | creation_time timestamp with time zone default now() |
---|
57 | ); |
---|
58 | -------------------------------------------------------------------------------- |
---|
59 | -- Files table |
---|
60 | -- Used to store the files generated during the service execution |
---|
61 | create table files ( |
---|
62 | uuid TEXT references services(uuid) ON DELETE CASCADE, |
---|
63 | filename text, |
---|
64 | nature varchar(10), |
---|
65 | name varchar(255), |
---|
66 | creation_time timestamp with time zone default now(), |
---|
67 | expiration_time timestamp with time zone default now() + interval '48 hours' |
---|
68 | ); |
---|
69 | -------------------------------------------------------------------------------- |
---|