~azzar1/unity/add-show-desktop-key

1099.1.142 by Nick Chadwick
Fixed a slight issue with the migration and the users.sql files not
1
BEGIN;
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
2
3
-- Check that the provided name is sane for use in URLs.
4
CREATE OR REPLACE FUNCTION valid_url_name(name text) RETURNS boolean AS 
5
$$
6
    BEGIN
1606.1.15 by William Grant
Permit underscores in all names.
7
        RETURN name ~ E'^[a-z0-9][a-z0-9_\+\.\-]*$';
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
8
    END;
9
$$ LANGUAGE 'plpgsql';
10
11
-- Just like valid_url_name, except that @ is permitted (so we can use a
12
-- reasonable subset of email addresses as usernames).
13
CREATE OR REPLACE FUNCTION valid_login_name(name text) RETURNS boolean AS 
14
$$
15
    BEGIN
1606.1.15 by William Grant
Permit underscores in all names.
16
        RETURN name ~ E'^[a-z0-9][a-z0-9@_\+\.\-]*$';
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
17
    END;
18
$$ LANGUAGE 'plpgsql';
19
936 by wagrant
userdb: Add the changes from migration 20080718-01 to users.sql. It was
20
CREATE SEQUENCE login_unixid_seq MINVALUE 1000 MAXVALUE 29999 START WITH 5000;
21
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
22
CREATE TABLE login (
446 by drtomc
users.sql: constrain the rolenm to be from a given set of roles.
23
    loginid     SERIAL PRIMARY KEY NOT NULL,
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
24
    login       VARCHAR UNIQUE NOT NULL CHECK (valid_login_name(login)),
446 by drtomc
users.sql: constrain the rolenm to be from a given set of roles.
25
    passhash    VARCHAR,
475 by mattgiuca
Commited some earlier changes to users.sql (not committed earlier due to
26
    state	VARCHAR NOT NULL CHECK (state in ('no_agreement', 'pending',
1080.1.69 by William Grant
userdb: login.state now defaults to 'no_agreement'.
27
                                              'enabled', 'disabled'))
28
                                 DEFAULT 'no_agreement',
1112 by matt.giuca
userdb/users.sql: Fixed two syntax errors. Jeepers!
29
    admin       BOOLEAN NOT NULL DEFAULT false,
936 by wagrant
userdb: Add the changes from migration 20080718-01 to users.sql. It was
30
    unixid      INT UNIQUE DEFAULT nextval('login_unixid_seq') NOT NULL,
475 by mattgiuca
Commited some earlier changes to users.sql (not committed earlier due to
31
    nick        VARCHAR NOT NULL,
32
    pass_exp    TIMESTAMP,
33
    acct_exp    TIMESTAMP,
34
    last_login  TIMESTAMP,
522 by drtomc
Add quite a lot of stuff to get usrmgt happening.
35
    svn_pass    VARCHAR,
462 by mattgiuca
userdb/users.sql: Added email field to login.
36
    email       VARCHAR,
446 by drtomc
users.sql: constrain the rolenm to be from a given set of roles.
37
    fullname    VARCHAR NOT NULL,
631 by mattgiuca
users.sql: Added "settings" field to the login table.
38
    studentid   VARCHAR, -- may be null
39
    settings    VARCHAR
25 by drtomc
A bit more work on the userdb stuff.
40
);
41
935 by wagrant
userdb: Large changes:
42
-- Subjects
43
-- --------
44
816 by mattgiuca
users.sql: Updated database schema; split subject and offering tables.
45
CREATE TABLE subject (
46
    subjectid       SERIAL PRIMARY KEY NOT NULL,
47
    subj_code       VARCHAR UNIQUE NOT NULL,
48
    subj_name       VARCHAR NOT NULL,
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
49
    subj_short_name VARCHAR UNIQUE NOT NULL CHECK (valid_url_name(subj_short_name))
816 by mattgiuca
users.sql: Updated database schema; split subject and offering tables.
50
);
51
935 by wagrant
userdb: Large changes:
52
CREATE TABLE semester (
53
    semesterid  SERIAL PRIMARY KEY NOT NULL,
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
54
    year        CHAR(4) NOT NULL CHECK (valid_url_name(year)),
55
    semester    CHAR(1) NOT NULL CHECK (valid_url_name(semester)),
1112 by matt.giuca
userdb/users.sql: Fixed two syntax errors. Jeepers!
56
    state       TEXT NOT NULL CHECK (state IN ('disabled', 'past',
57
                                    'current', 'future')) DEFAULT 'current',
935 by wagrant
userdb: Large changes:
58
    UNIQUE (year, semester)
59
);
60
353 by drtomc
Start addressing sb's suggestions.
61
CREATE TABLE offering (
324 by drtomc
Should all be okay now.
62
    offeringid  SERIAL PRIMARY KEY NOT NULL,
816 by mattgiuca
users.sql: Updated database schema; split subject and offering tables.
63
    subject     INT4 REFERENCES subject (subjectid) NOT NULL,
935 by wagrant
userdb: Large changes:
64
    semesterid  INTEGER REFERENCES semester (semesterid) NOT NULL,
1451.1.2 by William Grant
Move Subject.url to Offering, and add Offering.description. Show these on the offering index.
65
    description VARCHAR,
66
    url         VARCHAR,
935 by wagrant
userdb: Large changes:
67
    groups_student_permissions  VARCHAR NOT NULL DEFAULT 'none',
68
    CHECK (groups_student_permissions in ('none', 'invite', 'create')),
69
    UNIQUE (subject, semesterid)
70
);
71
72
-- Projects and groups
73
-- -------------------
74
75
CREATE TABLE project_set (
76
    projectsetid  SERIAL PRIMARY KEY NOT NULL,
77
    offeringid    INTEGER REFERENCES offering (offeringid) NOT NULL,
1165.1.45 by William Grant
Remove the NOT NULL and default from project_set.max_students_per_group.
78
    max_students_per_group  INTEGER
324 by drtomc
Should all be okay now.
79
);
80
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
81
CREATE TABLE project (
82
    projectid   SERIAL PRIMARY KEY NOT NULL,
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
83
    short_name  TEXT NOT NULL CHECK (valid_url_name(short_name)),
1165.1.3 by William Grant
Add NOT NULL name and short_name columns to project.
84
    name        TEXT NOT NULL,
85
    synopsis    TEXT,
86
    url         TEXT,
935 by wagrant
userdb: Large changes:
87
    projectsetid  INTEGER REFERENCES project_set (projectsetid) NOT NULL,
1316.1.1 by David Coles
Set project.deadline to NOT NULL since it is required for submits.
88
    deadline    TIMESTAMP NOT NULL
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
89
);
90
1165.1.3 by William Grant
Add NOT NULL name and short_name columns to project.
91
CREATE OR REPLACE FUNCTION check_project_namespacing_insertupdate()
92
RETURNS trigger AS '
93
    DECLARE
94
        oid INTEGER;
95
    BEGIN
96
        IF TG_OP = ''UPDATE'' THEN
97
            IF NEW.projectsetid = OLD.projectsetid AND NEW.short_name = OLD.short_name THEN
98
                RETURN NEW;
99
            END IF;
100
        END IF;
101
        SELECT offeringid INTO oid FROM project_set WHERE project_set.projectsetid = NEW.projectsetid;
102
        PERFORM 1 FROM project, project_set
103
        WHERE project_set.offeringid = oid AND
104
              project.projectsetid = project_set.projectsetid AND
105
              project.short_name = NEW.short_name;
106
        IF found THEN
107
            RAISE EXCEPTION ''a project named % already exists in offering ID %'', NEW.short_name, oid;
108
        END IF;
109
        RETURN NEW;
110
    END;
111
' LANGUAGE 'plpgsql';
112
113
CREATE TRIGGER check_project_namespacing
114
    BEFORE INSERT OR UPDATE ON project
115
    FOR EACH ROW EXECUTE PROCEDURE check_project_namespacing_insertupdate();
116
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
117
CREATE TABLE project_group (
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
118
    groupnm     VARCHAR NOT NULL CHECK (valid_url_name(groupnm)),
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
119
    groupid     SERIAL PRIMARY KEY NOT NULL,
935 by wagrant
userdb: Large changes:
120
    projectsetid  INTEGER REFERENCES project_set (projectsetid) NOT NULL,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
121
    nick        VARCHAR,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
122
    createdby   INT4 REFERENCES login (loginid) NOT NULL,
123
    epoch       TIMESTAMP NOT NULL,
935 by wagrant
userdb: Large changes:
124
    UNIQUE (projectsetid, groupnm)
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
125
);
126
935 by wagrant
userdb: Large changes:
127
CREATE OR REPLACE FUNCTION check_group_namespacing_insertupdate()
128
RETURNS trigger AS '
129
    DECLARE
130
        oid INTEGER;
131
    BEGIN
132
        SELECT offeringid INTO oid FROM project_set WHERE project_set.projectsetid = NEW.projectsetid;
1044 by wagrant
userdb: Properly verify that the group name is unique only within the
133
        PERFORM 1 FROM project_group, project_set WHERE project_set.offeringid = oid AND project_group.projectsetid = project_set.projectsetid AND project_group.groupnm = NEW.groupnm;
935 by wagrant
userdb: Large changes:
134
        IF found THEN
135
            RAISE EXCEPTION ''a project group named % already exists in offering ID %'', NEW.groupnm, oid;
136
        END IF;
137
        RETURN NEW;
138
    END;
139
' LANGUAGE 'plpgsql';
140
141
CREATE TRIGGER check_group_namespacing
142
    BEFORE INSERT OR UPDATE ON project_group
143
    FOR EACH ROW EXECUTE PROCEDURE check_group_namespacing_insertupdate();
144
353 by drtomc
Start addressing sb's suggestions.
145
CREATE TABLE group_invitation (
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
146
    loginid     INT4 REFERENCES login (loginid) NOT NULL,
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
147
    groupid     INT4 REFERENCES project_group (groupid) NOT NULL,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
148
    inviter     INT4 REFERENCES login (loginid) NOT NULL,
149
    invited     TIMESTAMP NOT NULL,
150
    accepted    TIMESTAMP,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
151
    UNIQUE (loginid,groupid)
25 by drtomc
A bit more work on the userdb stuff.
152
);
153
353 by drtomc
Start addressing sb's suggestions.
154
CREATE TABLE group_member (
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
155
    loginid     INT4 REFERENCES login (loginid),
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
156
    groupid     INT4 REFERENCES project_group (groupid),
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
157
    PRIMARY KEY (loginid,groupid)
25 by drtomc
A bit more work on the userdb stuff.
158
);
159
160
CREATE TABLE enrolment (
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
161
    loginid     INT4 REFERENCES login (loginid),
353 by drtomc
Start addressing sb's suggestions.
162
    offeringid  INT4 REFERENCES offering (offeringid),
1101 by William Grant
Privileges (apart from admin) are now offering-local, not global.
163
    role        TEXT NOT NULL CHECK (role IN ('student', 'tutor',
164
                                              'lecturer')) DEFAULT 'student',
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
165
    result      INT,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
166
    special_result VARCHAR,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
167
    supp_result INT,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
168
    special_supp_result VARCHAR,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
169
    notes       VARCHAR,
935 by wagrant
userdb: Large changes:
170
    active      BOOL NOT NULL DEFAULT true,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
171
    PRIMARY KEY (loginid,offeringid)
25 by drtomc
A bit more work on the userdb stuff.
172
);
173
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
174
CREATE TABLE assessed (
175
    assessedid  SERIAL PRIMARY KEY NOT NULL,
176
    loginid     INT4 REFERENCES login (loginid),
355 by drtomc
Fix a few typos and glitches to actually create the ivle database.
177
    groupid     INT4 REFERENCES project_group (groupid),
915 by mattgiuca
Moved projectid from all tables using assessedid into the assessed table
178
    projectid   INT4 REFERENCES project (projectid) NOT NULL,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
179
    -- exactly one of loginid and groupid must be non-null
180
    CHECK ((loginid IS NOT NULL AND groupid IS NULL)
181
        OR (loginid IS NULL AND groupid IS NOT NULL))
182
);
183
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
184
CREATE TABLE project_extension (
1165.1.2 by William Grant
Add serial primary keys to project_{extension,submission}.
185
    extensionid SERIAL PRIMARY KEY,
391 by drtomc
Fix a couple of typos.
186
    assessedid  INT4 REFERENCES assessed (assessedid) NOT NULL,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
187
    deadline    TIMESTAMP NOT NULL,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
188
    approver    INT4 REFERENCES login (loginid) NOT NULL,
189
    notes       VARCHAR
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
190
);
191
665 by drtomc
userdb: Add a submission table, as per our discussions.
192
CREATE TABLE project_submission (
1165.1.2 by William Grant
Add serial primary keys to project_{extension,submission}.
193
    submissionid SERIAL PRIMARY KEY,
665 by drtomc
userdb: Add a submission table, as per our discussions.
194
    assessedid  INT4 REFERENCES assessed (assessedid) NOT NULL,
195
    path        VARCHAR NOT NULL,
1165.1.1 by Matt Giuca
users.sql: Added to project_submission: 'date_submitted'.
196
    revision    INT4 NOT NULL,
1165.1.42 by William Grant
Record who submitted each submission.
197
    date_submitted TIMESTAMP NOT NULL,
198
    submitter   INT4 REFERENCES login (loginid) NOT NULL
665 by drtomc
userdb: Add a submission table, as per our discussions.
199
);
200
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
201
CREATE TABLE project_mark (
391 by drtomc
Fix a couple of typos.
202
    assessedid  INT4 REFERENCES assessed (assessedid) NOT NULL,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
203
    componentid INT4,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
204
    marker      INT4 REFERENCES login (loginid) NOT NULL,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
205
    mark        INT,
206
    marked      TIMESTAMP,
207
    feedback    VARCHAR,
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
208
    notes       VARCHAR
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
209
);
281 by stevenbird
extensive updates based on data modelling discussion with Tom Conway
210
935 by wagrant
userdb: Large changes:
211
-- Worksheets
212
-- ----------
1099.1.195 by William Grant
Rename problem to exercise in the DB.
213
CREATE TABLE exercise (
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
214
    identifier  TEXT PRIMARY KEY CHECK (valid_url_name(identifier)),
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
215
    name        TEXT,
216
    description TEXT,
217
    partial     TEXT,
218
    solution    TEXT,
219
    include     TEXT,
220
    num_rows    INT4
281 by stevenbird
extensive updates based on data modelling discussion with Tom Conway
221
);
222
725 by mattgiuca
The database now stores a cache of all the worksheets and what problems
223
CREATE TABLE worksheet (
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
224
    worksheetid SERIAL PRIMARY KEY,
225
    offeringid  INT4 REFERENCES offering (offeringid) NOT NULL,
1606.1.1 by William Grant
Add DB constraints for names used in URLs.
226
    identifier  TEXT NOT NULL CHECK (valid_url_name(identifier)),
1099.4.1 by Nick Chadwick
Working on putting worksheets into the database.
227
    name        TEXT NOT NULL,
1099.4.3 by Nick Chadwick
Updated the tutorial service, to now allow users to edit worksheets
228
    data        TEXT NOT NULL,
229
    assessable  BOOLEAN NOT NULL,
1099.1.184 by William Grant
Fix a column name mismatch between the migration and primary schema.
230
    seq_no      INT4 NOT NULL,
1099.4.3 by Nick Chadwick
Updated the tutorial service, to now allow users to edit worksheets
231
    format      TEXT NOT NUll,
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
232
    UNIQUE (offeringid, identifier)
725 by mattgiuca
The database now stores a cache of all the worksheets and what problems
233
);
234
1099.1.195 by William Grant
Rename problem to exercise in the DB.
235
CREATE TABLE worksheet_exercise (
236
    ws_ex_id        SERIAL PRIMARY KEY,
1099.4.3 by Nick Chadwick
Updated the tutorial service, to now allow users to edit worksheets
237
    worksheetid     INT4 REFERENCES worksheet (worksheetid) NOT NULL,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
238
    exerciseid      TEXT REFERENCES exercise (identifier) NOT NULL,
1099.1.185 by William Grant
A few almost-final worksheet/exercise schema changes. Mainly cosmetic.
239
    seq_no          INT4 NOT NULL,
240
    active          BOOLEAN NOT NULL DEFAULT true,
241
    optional        BOOLEAN NOT NULL,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
242
    UNIQUE (worksheetid, exerciseid)
725 by mattgiuca
The database now stores a cache of all the worksheets and what problems
243
);
244
1099.1.195 by William Grant
Rename problem to exercise in the DB.
245
CREATE TABLE exercise_attempt (
354 by drtomc
Addressed the rest of sb's suggestions. No doubt this will lead to more suggestions. :-)
246
    loginid     INT4 REFERENCES login (loginid) NOT NULL,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
247
    ws_ex_id    INT4 REFERENCES worksheet_exercise (ws_ex_id) NOT NULL,
319 by drtomc
Partial correctness for the user database schema. A few bits and pieces to go.
248
    date        TIMESTAMP NOT NULL,
1099.1.185 by William Grant
A few almost-final worksheet/exercise schema changes. Mainly cosmetic.
249
    attempt     TEXT NOT NULL,
296 by drtomc
Almost SQLized the database stuff from yesterday's discussion with sb.
250
    complete    BOOLEAN NOT NULL,
1021 by dcoles
Database: Adds active column to problem_attempt table.
251
    active      BOOLEAN NOT NULL DEFAULT true,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
252
    PRIMARY KEY (loginid, ws_ex_id, date)
281 by stevenbird
extensive updates based on data modelling discussion with Tom Conway
253
);
254
1099.1.195 by William Grant
Rename problem to exercise in the DB.
255
CREATE TABLE exercise_save (
697 by mattgiuca
users.sql: Added database table problem_save, for storing exercises that are
256
    loginid     INT4 REFERENCES login (loginid) NOT NULL,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
257
    ws_ex_id    INT4 REFERENCES worksheet_exercise (ws_ex_id) NOT NULL,
697 by mattgiuca
users.sql: Added database table problem_save, for storing exercises that are
258
    date        TIMESTAMP NOT NULL,
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
259
    text        TEXT NOT NULL,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
260
    PRIMARY KEY (loginid, ws_ex_id)
697 by mattgiuca
users.sql: Added database table problem_save, for storing exercises that are
261
);
262
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
263
CREATE TABLE test_suite (
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
264
    suiteid     SERIAL PRIMARY KEY,
1099.1.195 by William Grant
Rename problem to exercise in the DB.
265
    exerciseid  TEXT REFERENCES exercise (identifier) NOT NULL,
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
266
    description TEXT,
267
    seq_no      INT4,
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
268
    function    TEXT,
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
269
    stdin       TEXT
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
270
);
271
272
CREATE TABLE test_case (
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
273
    testid          SERIAL PRIMARY KEY,
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
274
    suiteid         INT4 REFERENCES test_suite (suiteid) NOT NULL,
275
    passmsg         TEXT,
276
    failmsg         TEXT,
277
    test_default    TEXT,
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
278
    seq_no          INT4
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
279
);
280
1099.1.195 by William Grant
Rename problem to exercise in the DB.
281
CREATE TABLE suite_variable (
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
282
    varid       SERIAL PRIMARY KEY,
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
283
    suiteid     INT4 REFERENCES test_suite (suiteid) NOT NULL,
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
284
    var_name    TEXT,
285
    var_value   TEXT,
286
    var_type    TEXT NOT NULL,
287
    arg_no      INT4
288
);
289
1099.1.195 by William Grant
Rename problem to exercise in the DB.
290
CREATE TABLE test_case_part (
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
291
    partid          SERIAL PRIMARY KEY,
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
292
    testid          INT4 REFERENCES test_case (testid) NOT NULL,
1099.1.145 by Nick Chadwick
Minor updates to the sql for the userdb
293
    part_type       TEXT NOT NULL,
1099.1.141 by Nick Chadwick
Updated the exercises to be loaded from the database, not a local file.
294
    test_type       TEXT,
295
    data            TEXT,
296
    filename        TEXT
1099.1.114 by Nick Chadwick
Modified the database so that exercises are now stored in the database, rather
297
);
1099.1.142 by Nick Chadwick
Fixed a slight issue with the migration and the users.sql files not
298
COMMIT;