From: Chris S. <san...@us...> - 2005-09-04 19:25:05
|
Update of /cvsroot/stack/stack-1-0/scripts/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12073/scripts/install Modified Files: stackInstall.php stackUpdateDatabase.php Log Message: **MAJOR** changes: added the Subject layer over the top, Index: stackUpdateDatabase.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackUpdateDatabase.php,v retrieving revision 1.7 retrieving revision 1.8 diff -C2 -d -r1.7 -r1.8 *** stackUpdateDatabase.php 30 Aug 2005 14:29:25 -0000 1.7 --- stackUpdateDatabase.php 4 Sep 2005 19:24:57 -0000 1.8 *************** *** 53,60 **** ADD COLUMN options text NULL;'; ! stack_mysqlcmd($addQuestionColumnQuery,$stack_mysql['user'],$error); stack_mysqlcmd($addQuizColumnQuery,$stack_mysql['user'],$error); stack_mysqlcmd($addUserColumnQuery,$stack_mysql['user'],$error); --- 53,69 ---- ADD COLUMN options text NULL;'; ! // Below added by CJS, 04/9/2005 ! stack_mysqlcmd($addQuestionColumnQuery,$stack_mysql['user'],$error); stack_mysqlcmd($addQuizColumnQuery,$stack_mysql['user'],$error); stack_mysqlcmd($addUserColumnQuery,$stack_mysql['user'],$error); + + // + + $query = 'ALTER TABLE quizattempts + ADD COLUMN subjectID int(11) default NULL;'; + + stack_mysqlcmd($query,$stack_mysql['user'],$error); + Index: stackInstall.php =================================================================== RCS file: /cvsroot/stack/stack-1-0/scripts/install/stackInstall.php,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** stackInstall.php 29 Aug 2005 18:41:03 -0000 1.17 --- stackInstall.php 4 Sep 2005 19:24:57 -0000 1.18 *************** *** 235,238 **** --- 235,239 ---- $qu = "CREATE TABLE IF NOT EXISTS quizAttempts ( attemptID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + subjectID int(11) default NULL, quizID int(11) default NULL, userID int(11) default NULL, *************** *** 244,247 **** --- 245,279 ---- stack_mysqlcmd($qu,$stack_mysql['user'],$err); + // (9) Create the subject table + + // Create field list + $qu = ''; + foreach ($stackSubject as $key => $val) { + $qu .= ", $key {$val['mysql']}"; + } + $qu = substr($qu,1,strlen($qu)-1); + $qu = "CREATE TABLE IF NOT EXISTS stackSubject ( {$qu} );"; + + stack_mysqlcmd($qu,$stack_mysql['user'],$err); + + // (10) Create the table to link quizzes to subjects + + $qu = "CREATE TABLE IF NOT EXISTS subject_quiz ( + ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + subjectID INT, + quizid INT, + qord INT ); "; + + stack_mysqlcmd($qu,$stack_mysql['user'],$err); + + // (11) Create the table to link users to subjects + + $qu = "CREATE TABLE IF NOT EXISTS user_subject ( + ID INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY, + userID INT, + subjectID INT); "; + + stack_mysqlcmd($qu,$stack_mysql['user'],$err); + // /************************************************/ // /* (500) RQP tables have been created. */ |