1
DO NOT APPLY THIS MIGRATION WITHOUT READING THE FOLLOWING;
4
DROP TABLE problem_attempt_breakdown;
5
DROP TABLE problem_test_case_tag;
6
DROP TABLE problem_tag;
7
DROP TABLE problem_test_case;
8
DROP TABLE problem_prerequisite;
9
TRUNCATE worksheet_problem, worksheet;
11
ALTER TABLE problem_attempt DROP CONSTRAINT problem_attempt_problemid_fkey;
12
ALTER TABLE problem_save DROP CONSTRAINT problem_save_problemid_fkey;
13
ALTER TABLE worksheet_problem DROP CONSTRAINT worksheet_problem_problemid_fkey;
15
ALTER TABLE problem ADD COLUMN name TEXT;
16
ALTER TABLE problem ADD COLUMN description TEXT;
17
ALTER TABLE problem ADD COLUMN partial TEXT;
18
ALTER TABLE problem ADD COLUMN solution TEXT;
19
ALTER TABLE problem ADD COLUMN include TEXT;
20
ALTER TABLE problem ADD COLUMN num_rows INT4;
21
ALTER TABLE problem DROP COLUMN spec;
22
ALTER TABLE problem DROP COLUMN problemid;
24
ALTER TABLE problem_attempt ADD COLUMN worksheetid INT4 REFERENCES worksheet (worksheetid);
25
ALTER TABLE problem_attempt DROP COLUMN problemid;
26
ALTER TABLE problem_attempt ADD COLUMN problemid TEXT REFERENCES problem (identifier);
28
ALTER TABLE problem_save ADD COLUMN worksheetid INT4 REFERENCES worksheet (worksheetid);
29
ALTER TABLE problem_save DROP COLUMN problemid;
30
ALTER TABLE problem_save ADD COLUMN problemid TEXT references problem (identifier);
32
ALTER TABLE worksheet_problem DROP COLUMN problemid;
33
ALTER TABLE worksheet_problem ADD COLUMN problemid TEXT REFERENCES problem (identifier);
35
CREATE TABLE test_suite (
36
suiteid SERIAL UNIQUE NOT NULL,
37
problemid TEXT REFERENCES problem (identifier) NOT NULL,
40
PRIMARY KEY (problemid, suiteid)
43
CREATE TABLE test_case (
44
testid SERIAL UNIQUE NOT NULL,
45
suiteid INT4 REFERENCES test_suite (suiteid) NOT NULL,
53
PRIMARY KEY (testid, suiteid)
56
ALTER TABLE worksheet ADD COLUMN offeringid INT4 REFERENCES offering (offeringid) NOT NULL;