]> git.evergreen-ils.org Git - working/Evergreen.git/blob - Open-ILS/src/sql/Pg/001.schema.offline.sql
Add purchase_order column to acq.edi_message.
[working/Evergreen.git] / Open-ILS / src / sql / Pg / 001.schema.offline.sql
1 /*
2  * Copyright (C) 2004-2008  Georgia Public Library Service
3  * Copyright (C) 2008  Equinox Software, Inc.
4  * Mike Rylander <miker@esilibrary.com>
5  *
6  * This program is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * as published by the Free Software Foundation; either version 2
9  * of the License, or (at your option) any later version.
10  *
11  * This program is distributed in the hope that it will be useful,
12  * but WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  *
16  */
17
18
19 DROP SCHEMA offline CASCADE;
20
21 BEGIN;
22
23 CREATE SCHEMA offline;
24
25 CREATE TABLE offline.script (
26         id              SERIAL PRIMARY KEY,
27         session         TEXT    NOT NULL,
28         requestor       INTEGER NOT NULL,
29         create_time     INTEGER NOT NULL,
30         workstation     TEXT    NOT NULL,
31         logfile         TEXT    NOT NULL,
32         time_delta      INTEGER NOT NULL DEFAULT 0,
33         count           INTEGER NOT NULL DEFAULT 0
34 );
35 CREATE INDEX offline_script_pkey ON offline.script (id);
36 CREATE INDEX offline_script_ws ON offline.script (workstation);
37 CREATE INDEX offline_script_session ON offline.script (session);
38
39
40 CREATE TABLE offline.session (
41         key             TEXT    PRIMARY KEY,
42         org             INTEGER NOT NULL,
43         description     TEXT,
44         creator         INTEGER NOT NULL,
45         create_time     INTEGER NOT NULL,
46         in_process      INTEGER NOT NULL DEFAULT 0,
47         start_time      INTEGER,
48         end_time        INTEGER,
49         num_complete    INTEGER NOT NULL DEFAULT 0
50 );
51 CREATE INDEX offline_session_pkey ON offline.session (key);
52 CREATE INDEX offline_session_org ON offline.session (org);
53 CREATE INDEX offline_session_creation ON offline.session (create_time);
54
55 COMMIT;
56