Skip to content

Commit

Permalink
Some additions for postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
paca70 committed May 18, 2003
1 parent c563a9a commit 775f689
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 6 deletions.
20 changes: 17 additions & 3 deletions mod/workshop/db/postgres7.php
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
<?PHP // $Id$

function gallery_upgrade($oldversion) {
function workshop_upgrade($oldversion) {
// This function does anything necessary to upgrade
// older versions to match current functionality

global $CFG;

if ($oldversion < 2003043000) {
if ($oldversion < 2003050400) {
table_column("workshop","graded", "agreeassessments", "INT","2", "", "0" ,"NOT NULL");
table_column("workshop", "showgrades","hidegrades", "INT","2", "","0", "NOT NULL");
table_column("workshop_assessments","","timeagreed", "INT","8", "UNSIGNED", "0", "NOT NULL" );

}
execute_sql("
CREATE TABLE {$CFG->prefix}workshop_comments (
id SERIAL8 PRIMARY KEY ,
workshopid int8 NOT NULL default '0',
assessmentid int8 NOT NULL default '0',
userid int8 NOT NULL default '0',
timecreated int8 NOT NULL default '0',
mailed int2 NOT NULL default '0',
comments text NOT NULL
)
");
}
return true;
}

Expand Down
17 changes: 14 additions & 3 deletions mod/workshop/db/postgres7.sql
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ CREATE TABLE prefix_workshop (
format INT2 NOT NULL default '0',
gradingstrategy INT2 NOT NULL default '1',
resubmit INT2 NOT NULL default '0',
graded INT2 NOT NULL default '1',
showgrades INT2 NOT NULL default '0',
agreeassessments INT2 NOT NULL default '0',
hidegrades INT2 NOT NULL default '0',
anonymous INT2 NOT NULL default '0',
includeself INT2 NOT NULL default '0',
maxbytes INT8 NOT NULL default '100000',
Expand All @@ -28,7 +28,8 @@ CREATE TABLE prefix_workshop (
includeteachersgrade INT NOT NULL default '0',
biasweight INT NOT NULL default '5',
reliabilityweight INT NOT NULL default '5',
gradingweight INT NOT NULL default '5'
gradingweight INT NOT NULL default '5',
timeagreed INT8 NOT NULL default '0'
);
# --------------------------------------------------------

Expand Down Expand Up @@ -100,6 +101,16 @@ CREATE TABLE prefix_workshop_grades (
grade INT NOT NULL default '0'
);
# --------------------------------------------------------
CREATE TABLE prefix_workshop_comments (
id SERIAL8 PRIMARY KEY,
workshopid int8 NOT NULL default '0',
assessmentid int8 NOT NULL default '0',
userid int8 NOT NULL default '0',
timecreated int8 NOT NULL default '0',
mailed int2 NOT NULL default '0',
comments text NOT NULL
);


INSERT INTO prefix_log_display VALUES ('workshop', 'assess', 'workshop', 'name');
INSERT INTO prefix_log_display VALUES ('workshop', 'close', 'workshop', 'name');
Expand Down

0 comments on commit 775f689

Please sign in to comment.