]> git.mjollnir.org Git - moodle.git/commitdiff
Wery quickly tested and untested versions for Postgresql.
authorpaca70 <paca70>
Wed, 28 Jul 2004 08:51:05 +0000 (08:51 +0000)
committerpaca70 <paca70>
Wed, 28 Jul 2004 08:51:05 +0000 (08:51 +0000)
mod/forum/db/postgres7.php
mod/glossary/db/postgres7.php
mod/quiz/db/postgres7.php
mod/resource/db/postgres7.php
mod/scorm/db/postgres7.php
mod/wiki/db/postgres7.php [new file with mode: 0644]
mod/wiki/db/postgres7.sql [new file with mode: 0644]

index ca844f7cf07e8c3255228d8342ae0c87355bc0fb..8f2cc67c4509f9120338eab90e16e28c77405857 100644 (file)
@@ -54,7 +54,7 @@ function forum_upgrade($oldversion) {
   }
 
   if ($oldversion < 2004060100) {
-      modify_database('', "CREATE TABLE `prefix_forum_queue` (
+      modify_database('', "CREATE TABLE prefix_forum_queue (
                            id SERIAL PRIMARY KEY,
                            userid integer default 0 NOT NULL,
                            discussionid integer default 0 NOT NULL,
index 1c9e6f734091fd704bacedbbbdfe6db262792845..0f654484c2c81ab21f81a14370378c1852c74bd4 100644 (file)
@@ -40,18 +40,17 @@ function glossary_upgrade($oldversion) {
   if ( $oldversion < 2004072400) {
 
       //Create new table glossary_formats to store format info
-      execute_sql("CREATE TABLE `{$CFG->prefix}glossary_formats` (
-                       `id` INT(10) unsigned NOT NULL auto_increment,
-                       `name` VARCHAR(50) NOT NULL,
-                       `popupformatname` VARCHAR(50) NOT NULL, 
-                       `visible` int2 UNSIGNED NOT NULL default '1',
-                       `showgroup int2 UNSIGNED NOT NULL default '1',
-                       `defaultmode` VARCHAR(50) NOT NULL default '',
-                       `defaulthook` VARCHAR(50) NOT NULL default '',
-                       `sortkey` VARCHAR(50) NOT NULL default '',
-                       `sortorder` VARCHAR(50) NOT NULL default '',
-                   PRIMARY KEY  (`id`)                    
-                   ) TYPE=MyISAM COMMENT='Setting of the display formats'");
+      execute_sql("CREATE TABLE {$CFG->prefix}glossary_formats (
+                       id SERIAL8 PRIMARY KEY,
+                       name VARCHAR(50) NOT NULL,
+                       popupformatname VARCHAR(50) NOT NULL, 
+                       visible int2  NOT NULL default '1',
+                       showgroup int2  NOT NULL default '1',
+                       defaultmode VARCHAR(50) NOT NULL default '',
+                       defaulthook VARCHAR(50) NOT NULL default '',
+                       sortkey VARCHAR(50) NOT NULL default '',
+                       sortorder VARCHAR(50) NOT NULL default ''
+                   ) ");
 
       //Define current 0-6 format names
       $formatnames = array('dictionary','continuous','fullwithauthor','encyclopedia',
@@ -81,7 +80,7 @@ function glossary_upgrade($oldversion) {
       }
 
       //Drop the old formats table
-      execute_sql("DROP TABLE `{$CFG->prefix}glossary_displayformats`");
+      execute_sql("DROP TABLE {$CFG->prefix}glossary_displayformats");
 
       //Modify the glossary->displayformat field
       table_column('glossary', 'displayformat', 'displayformat', 'VARCHAR', '50', '', 'dictionary', 'NOT NULL');
index 108952a76eb703ff15a36a5ef80f7566e6109029..6a00ca7588a29fa0b822c11b403a629dd3beacfc 100644 (file)
@@ -150,7 +150,7 @@ function quiz_upgrade($oldversion) {
         quiz_refresh_events();
     }
     if ($oldversion < 2004060200) {
-        execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD timelimit integer DEFAULT '0' NOT NULL ");
+        table_column("quiz", "", "timelimit", "integer", "", "", "0", "NOT NULL", "");
     }
 
     if ($oldversion < 2004070700) {
index 3c94fb93fa95bfb05e3a750863f828de58f8f8ec..fa37b6fd00edc9bb215455553e0c00e2d09a0764 100644 (file)
@@ -3,6 +3,8 @@
 function resource_upgrade($oldversion) {
 // This function does anything necessary to upgrade
 // older versions to match current functionality
+    
+    global $CFG ;
 
     if ($oldversion < 2004013101) {
         modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');");
index f27436e5636bfaf0cd1f7baab64f2f1b6782834d..4ac8e0146f126cba6879620b3fc88185187b6d69 100755 (executable)
@@ -16,7 +16,7 @@ function scorm_upgrade($oldversion) {
     }
     if ($oldversion < 2004070800) {
        table_column("scorm_scoes", "", "datafromlms", "TEXT", "", "", "", "NOT NULL", "title");
-       modify_database("", "ALTER TABLE `{$CFG->prefix}scorm_sco_users` DROP `cmi_launch_data`;");
+       modify_database("", "ALTER TABLE {$CFG->prefix}scorm_sco_users DROP cmi_launch_data;");
     }
     if ($oldversion < 2004071700) {
        table_column("scorm_scoes", "", "manifest", "VARCHAR", "255", "", "", "NOT NULL", "scorm");
diff --git a/mod/wiki/db/postgres7.php b/mod/wiki/db/postgres7.php
new file mode 100644 (file)
index 0000000..cea8de2
--- /dev/null
@@ -0,0 +1,13 @@
+<?PHP
+
+function wiki_upgrade($oldversion) {
+/// This function does anything necessary to upgrade 
+/// older versions to match current functionality 
+
+    global $CFG;
+
+
+    return true;
+}
+
+?>
diff --git a/mod/wiki/db/postgres7.sql b/mod/wiki/db/postgres7.sql
new file mode 100644 (file)
index 0000000..4a80df8
--- /dev/null
@@ -0,0 +1,58 @@
+# This file contains a complete database schema for all the
+# tables used by this module, written in SQL
+
+# It may also contain INSERT statements for particular data
+# that may be used, especially new entries in the table log_display
+
+
+CREATE TABLE prefix_wiki (
+  id SERIAL8 PRIMARY KEY,
+  course INT8  NOT NULL default '0',
+  name varchar(255) NOT NULL default '',
+  summary text NOT NULL,
+  pagename varchar(255) ,
+  wtype VARCHAR default 'group' CHECK( wtype IN('teacher', 'group', 'student')),
+  ewikiprinttitle INT NOT NULL default '1',
+  htmlmode INT NOT NULL default '0',
+  ewikiacceptbinary INT NOT NULL default '0',
+  disablecamelcase INT NOT NULL default '0',
+  setpageflags INT NOT NULL default '1',
+  strippages INT NOT NULL default '1',
+  removepages INT NOT NULL default '1',
+  revertchanges INT NOT NULL default '1',
+  initialcontent varchar(255) ,
+  timemodified INT8 NOT NULL default '0'
+) ;
+
+
+#
+# Table structure for table mdl_wiki_entries
+#
+
+CREATE TABLE prefix_wiki_entries (
+  id SERIAL8 PRIMARY KEY,
+  wikiid INT8 NOT NULL default '0',
+  course INT8 NOT NULL default '0',
+  groupid INT8 NOT NULL default '0',
+  userid INT8 NOT NULL default '0',
+  pagename varchar(255) NOT NULL default '',
+  timemodified INT8 NOT NULL default '0'
+) ;
+
+
+CREATE TABLE prefix_wiki_pages (
+  id SERIAL PRIMARY KEY,
+  pagename VARCHAR(160) NOT NULL,
+  version INTEGER  NOT NULL DEFAULT 0,
+  flags INTEGER  DEFAULT 0,
+  content TEXT,
+  author VARCHAR(100) DEFAULT 'ewiki',
+  created INTEGER  DEFAULT 0,
+  lastmodified INTEGER  DEFAULT 0,
+  refs TEXT,
+  meta TEXT,
+  hits INTEGER  DEFAULT 0,
+  wiki INT8  NOT NULL
+) ;
+
+CREATE INDEX prefix_wiki_pages_pagename_version_wiki_idx ON prefix_wiki_pages (pagename, version, wiki) ;