Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Wery quickly tested and untested versions for Postgresql.

  • Loading branch information...
commit edf693decff20a96cb1f113e992a76e2a71b9621 1 parent 3a1ec11
authored July 28, 2004
2  mod/forum/db/postgres7.php
@@ -54,7 +54,7 @@ function forum_upgrade($oldversion) {
54 54
   }
55 55
 
56 56
   if ($oldversion < 2004060100) {
57  
-      modify_database('', "CREATE TABLE `prefix_forum_queue` (
  57
+      modify_database('', "CREATE TABLE prefix_forum_queue (
58 58
                            id SERIAL PRIMARY KEY,
59 59
                            userid integer default 0 NOT NULL,
60 60
                            discussionid integer default 0 NOT NULL,
25  mod/glossary/db/postgres7.php
@@ -40,18 +40,17 @@ function glossary_upgrade($oldversion) {
40 40
   if ( $oldversion < 2004072400) {
41 41
 
42 42
       //Create new table glossary_formats to store format info
43  
-      execute_sql("CREATE TABLE `{$CFG->prefix}glossary_formats` (
44  
-                       `id` INT(10) unsigned NOT NULL auto_increment,
45  
-                       `name` VARCHAR(50) NOT NULL,
46  
-                       `popupformatname` VARCHAR(50) NOT NULL, 
47  
-                       `visible` int2 UNSIGNED NOT NULL default '1',
48  
-                       `showgroup int2 UNSIGNED NOT NULL default '1',
49  
-                       `defaultmode` VARCHAR(50) NOT NULL default '',
50  
-                       `defaulthook` VARCHAR(50) NOT NULL default '',
51  
-                       `sortkey` VARCHAR(50) NOT NULL default '',
52  
-                       `sortorder` VARCHAR(50) NOT NULL default '',
53  
-                   PRIMARY KEY  (`id`)                    
54  
-                   ) TYPE=MyISAM COMMENT='Setting of the display formats'");
  43
+      execute_sql("CREATE TABLE {$CFG->prefix}glossary_formats (
  44
+                       id SERIAL8 PRIMARY KEY,
  45
+                       name VARCHAR(50) NOT NULL,
  46
+                       popupformatname VARCHAR(50) NOT NULL, 
  47
+                       visible int2  NOT NULL default '1',
  48
+                       showgroup int2  NOT NULL default '1',
  49
+                       defaultmode VARCHAR(50) NOT NULL default '',
  50
+                       defaulthook VARCHAR(50) NOT NULL default '',
  51
+                       sortkey VARCHAR(50) NOT NULL default '',
  52
+                       sortorder VARCHAR(50) NOT NULL default ''
  53
+                   ) ");
55 54
 
56 55
       //Define current 0-6 format names
57 56
       $formatnames = array('dictionary','continuous','fullwithauthor','encyclopedia',
@@ -81,7 +80,7 @@ function glossary_upgrade($oldversion) {
81 80
       }
82 81
 
83 82
       //Drop the old formats table
84  
-      execute_sql("DROP TABLE `{$CFG->prefix}glossary_displayformats`");
  83
+      execute_sql("DROP TABLE {$CFG->prefix}glossary_displayformats");
85 84
 
86 85
       //Modify the glossary->displayformat field
87 86
       table_column('glossary', 'displayformat', 'displayformat', 'VARCHAR', '50', '', 'dictionary', 'NOT NULL');
2  mod/quiz/db/postgres7.php
@@ -150,7 +150,7 @@ function quiz_upgrade($oldversion) {
150 150
         quiz_refresh_events();
151 151
     }
152 152
     if ($oldversion < 2004060200) {
153  
-        execute_sql(" ALTER TABLE {$CFG->prefix}quiz ADD timelimit integer DEFAULT '0' NOT NULL ");
  153
+        table_column("quiz", "", "timelimit", "integer", "", "", "0", "NOT NULL", "");
154 154
     }
155 155
 
156 156
     if ($oldversion < 2004070700) {
2  mod/resource/db/postgres7.php
@@ -3,6 +3,8 @@
3 3
 function resource_upgrade($oldversion) {
4 4
 // This function does anything necessary to upgrade
5 5
 // older versions to match current functionality
  6
+    
  7
+    global $CFG ;
6 8
 
7 9
     if ($oldversion < 2004013101) {
8 10
         modify_database("", "INSERT INTO prefix_log_display VALUES ('resource', 'update', 'resource', 'name');");
2  mod/scorm/db/postgres7.php
@@ -16,7 +16,7 @@ function scorm_upgrade($oldversion) {
16 16
     }
17 17
     if ($oldversion < 2004070800) {
18 18
     	table_column("scorm_scoes", "", "datafromlms", "TEXT", "", "", "", "NOT NULL", "title");
19  
-    	modify_database("", "ALTER TABLE `{$CFG->prefix}scorm_sco_users` DROP `cmi_launch_data`;");
  19
+    	modify_database("", "ALTER TABLE {$CFG->prefix}scorm_sco_users DROP cmi_launch_data;");
20 20
     }
21 21
     if ($oldversion < 2004071700) {
22 22
     	table_column("scorm_scoes", "", "manifest", "VARCHAR", "255", "", "", "NOT NULL", "scorm");
13  mod/wiki/db/postgres7.php
... ...
@@ -0,0 +1,13 @@
  1
+<?PHP
  2
+
  3
+function wiki_upgrade($oldversion) {
  4
+/// This function does anything necessary to upgrade 
  5
+/// older versions to match current functionality 
  6
+
  7
+    global $CFG;
  8
+
  9
+
  10
+    return true;
  11
+}
  12
+
  13
+?>
58  mod/wiki/db/postgres7.sql
... ...
@@ -0,0 +1,58 @@
  1
+# This file contains a complete database schema for all the
  2
+# tables used by this module, written in SQL
  3
+
  4
+# It may also contain INSERT statements for particular data
  5
+# that may be used, especially new entries in the table log_display
  6
+
  7
+
  8
+CREATE TABLE prefix_wiki (
  9
+  id SERIAL8 PRIMARY KEY,
  10
+  course INT8  NOT NULL default '0',
  11
+  name varchar(255) NOT NULL default '',
  12
+  summary text NOT NULL,
  13
+  pagename varchar(255) ,
  14
+  wtype VARCHAR default 'group' CHECK( wtype IN('teacher', 'group', 'student')),
  15
+  ewikiprinttitle INT NOT NULL default '1',
  16
+  htmlmode INT NOT NULL default '0',
  17
+  ewikiacceptbinary INT NOT NULL default '0',
  18
+  disablecamelcase INT NOT NULL default '0',
  19
+  setpageflags INT NOT NULL default '1',
  20
+  strippages INT NOT NULL default '1',
  21
+  removepages INT NOT NULL default '1',
  22
+  revertchanges INT NOT NULL default '1',
  23
+  initialcontent varchar(255) ,
  24
+  timemodified INT8 NOT NULL default '0'
  25
+) ;
  26
+
  27
+
  28
+#
  29
+# Table structure for table mdl_wiki_entries
  30
+#
  31
+
  32
+CREATE TABLE prefix_wiki_entries (
  33
+  id SERIAL8 PRIMARY KEY,
  34
+  wikiid INT8 NOT NULL default '0',
  35
+  course INT8 NOT NULL default '0',
  36
+  groupid INT8 NOT NULL default '0',
  37
+  userid INT8 NOT NULL default '0',
  38
+  pagename varchar(255) NOT NULL default '',
  39
+  timemodified INT8 NOT NULL default '0'
  40
+) ;
  41
+
  42
+
  43
+CREATE TABLE prefix_wiki_pages (
  44
+  id SERIAL PRIMARY KEY,
  45
+  pagename VARCHAR(160) NOT NULL,
  46
+  version INTEGER  NOT NULL DEFAULT 0,
  47
+  flags INTEGER  DEFAULT 0,
  48
+  content TEXT,
  49
+  author VARCHAR(100) DEFAULT 'ewiki',
  50
+  created INTEGER  DEFAULT 0,
  51
+  lastmodified INTEGER  DEFAULT 0,
  52
+  refs TEXT,
  53
+  meta TEXT,
  54
+  hits INTEGER  DEFAULT 0,
  55
+  wiki INT8  NOT NULL
  56
+) ;
  57
+
  58
+CREATE INDEX prefix_wiki_pages_pagename_version_wiki_idx ON prefix_wiki_pages (pagename, version, wiki) ;

0 notes on commit edf693d

Please sign in to comment.
Something went wrong with that request. Please try again.