Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Wery quickly tested and untested versions for Postgresql.

  • Loading branch information...
commit edf693decff20a96cb1f113e992a76e2a71b9621 1 parent 3a1ec11
paca70 authored
View
2  mod/forum/db/postgres7.php
@@ -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,
View
25 mod/glossary/db/postgres7.php
@@ -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');
View
2  mod/quiz/db/postgres7.php
@@ -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) {
View
2  mod/resource/db/postgres7.php
@@ -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');");
View
2  mod/scorm/db/postgres7.php
@@ -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");
View
13 mod/wiki/db/postgres7.php
@@ -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;
+}
+
+?>
View
58 mod/wiki/db/postgres7.sql
@@ -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) ;
Please sign in to comment.
Something went wrong with that request. Please try again.