Permalink
Browse files

More fixes for postgreSQL etc

  • Loading branch information...
1 parent 6aeec7f commit a3eea09cc900e68909019fa3724ec2467167e9d0 moodler committed Dec 23, 2002
View
@@ -225,6 +225,12 @@ function main_upgrade($oldversion=0) {
execute_sql("ALTER TABLE `user_students` CHANGE `end` `timeend` INT(10) UNSIGNED DEFAULT '0' NOT NULL ");
}
+ if ($oldversion < 2002122301) {
+ if (! record_exists_select("log_display", "", "user", "", "view")) {
+ execute_sql("INSERT INTO {$CFG->prefix}log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)') ");
+ }
+ }
+
return true;
}
View
@@ -227,3 +227,4 @@ CREATE TABLE `prefix_user_teachers` (
UNIQUE KEY `id` (`id`)
) TYPE=MyISAM COMMENT='One record per teacher per course';
+INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname,' ',lastname)');
View
@@ -1,11 +1,11 @@
-CREATE TABLE config (
+CREATE TABLE prefix_config (
id SERIAL PRIMARY KEY,
name varchar(255) NOT NULL default '',
value varchar(255) NOT NULL default '',
CONSTRAINT config_name_uk UNIQUE (name)
);
-CREATE TABLE course (
+CREATE TABLE prefix_course (
id SERIAL PRIMARY KEY,
category integer NOT NULL default '0',
password varchar(50) NOT NULL default '',
@@ -27,12 +27,12 @@ CREATE TABLE course (
timemodified integer NOT NULL default '0'
);
-CREATE TABLE course_categories (
+CREATE TABLE prefix_course_categories (
id SERIAL PRIMARY KEY,
name varchar(255) NOT NULL default ''
);
-CREATE TABLE course_modules (
+CREATE TABLE prefix_course_modules (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
module integer NOT NULL default '0',
@@ -43,15 +43,15 @@ CREATE TABLE course_modules (
score integer NOT NULL default '0'
);
-CREATE TABLE course_sections (
+CREATE TABLE prefix_course_sections (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
section integer NOT NULL default '0',
summary text NOT NULL default '',
sequence varchar(255) NOT NULL default ''
);
-CREATE TABLE log (
+CREATE TABLE prefix_log (
id SERIAL PRIMARY KEY,
time integer NOT NULL default '0',
userid integer NOT NULL default '0',
@@ -63,14 +63,14 @@ CREATE TABLE log (
info varchar(255) NOT NULL default ''
);
-CREATE TABLE log_display (
+CREATE TABLE prefix_log_display (
module varchar(20) NOT NULL default '',
action varchar(20) NOT NULL default '',
mtable varchar(20) NOT NULL default '',
field varchar(40) NOT NULL default ''
);
-CREATE TABLE modules (
+CREATE TABLE prefix_modules (
id SERIAL PRIMARY KEY,
name varchar(20) NOT NULL default '',
version integer NOT NULL default '0',
@@ -79,7 +79,7 @@ CREATE TABLE modules (
search varchar(255) NOT NULL default ''
);
-CREATE TABLE "user" (
+CREATE TABLE prefix_user (
id SERIAL PRIMARY KEY,
confirmed integer NOT NULL default '0',
deleted integer NOT NULL default '0',
@@ -113,12 +113,12 @@ CREATE TABLE "user" (
CONSTRAINT user_username_uk UNIQUE (username)
);
-CREATE TABLE user_admins (
+CREATE TABLE prefix_user_admins (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0'
);
-CREATE TABLE user_students (
+CREATE TABLE prefix_user_students (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0',
course integer NOT NULL default '0',
@@ -127,10 +127,13 @@ CREATE TABLE user_students (
time integer NOT NULL default '0'
);
-CREATE TABLE user_teachers (
+CREATE TABLE prefix_user_teachers (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0',
course integer NOT NULL default '0',
authority integer NOT NULL default '3',
role varchar(40) NOT NULL default ''
);
+
+
+INSERT INTO prefix_log_display VALUES ('user', 'view', 'user', 'CONCAT(firstname," ",lastname)');
@@ -2,7 +2,7 @@
# Table structure for table assignment
#
-CREATE TABLE assignment (
+CREATE TABLE prefix_assignment (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
@@ -20,7 +20,7 @@ CREATE TABLE assignment (
# Table structure for table assignment_submissions
#
-CREATE TABLE assignment_submissions (
+CREATE TABLE prefix_assignment_submissions (
id SERIAL PRIMARY KEY,
assignment integer NOT NULL default '0',
userid integer NOT NULL default '0',
@@ -36,9 +36,9 @@ CREATE TABLE assignment_submissions (
# --------------------------------------------------------
-INSERT INTO log_display VALUES ('assignment', 'view', 'assignment', 'name');
-INSERT INTO log_display VALUES ('assignment', 'add', 'assignment', 'name');
-INSERT INTO log_display VALUES ('assignment', 'update', 'assignment', 'name');
-INSERT INTO log_display VALUES ('assignment', 'view submissions', 'assignment', 'name');
-INSERT INTO log_display VALUES ('assignment', 'upload', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'view', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'add', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'update', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'view submissions', 'assignment', 'name');
+INSERT INTO prefix_log_display VALUES ('assignment', 'upload', 'assignment', 'name');
@@ -14,7 +14,7 @@
# Table structure for table `choice`
#
-CREATE TABLE choice (
+CREATE TABLE prefix_choice (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
name varchar(255) NOT NULL default '',
@@ -35,7 +35,7 @@ CREATE TABLE choice (
# Table structure for table `choice_answers`
#
-CREATE TABLE choice_answers (
+CREATE TABLE prefix_choice_answers (
id SERIAL PRIMARY KEY,
choice integer NOT NULL default '0',
userid integer NOT NULL default '0',
@@ -47,10 +47,10 @@ CREATE TABLE choice_answers (
# Dumping data for table `log_display`
#
-INSERT INTO log_display VALUES ('choice', 'view', 'choice', 'name');
-INSERT INTO log_display VALUES ('choice', 'update', 'choice', 'name');
-INSERT INTO log_display VALUES ('choice', 'add', 'choice', 'name');
-INSERT INTO log_display VALUES ('choice', 'report', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'view', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'update', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'add', 'choice', 'name');
+INSERT INTO prefix_log_display VALUES ('choice', 'report', 'choice', 'name');
@@ -2,7 +2,7 @@
# Table structure for table `forum`
#
-CREATE TABLE forum (
+CREATE TABLE prefix_forum (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
type varchar(10) CHECK (type IN ('single','news','general','social','eachuser','teacher')) NOT NULL default 'general',
@@ -19,7 +19,7 @@ CREATE TABLE forum (
# Table structure for table `forum_discussions`
#
-CREATE TABLE forum_discussions (
+CREATE TABLE prefix_forum_discussions (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
forum integer NOT NULL default '0',
@@ -34,7 +34,7 @@ CREATE TABLE forum_discussions (
# Table structure for table `forum_posts`
#
-CREATE TABLE forum_posts (
+CREATE TABLE prefix_forum_posts (
id SERIAL PRIMARY KEY,
discussion integer NOT NULL default '0',
parent integer NOT NULL default '0',
@@ -54,7 +54,7 @@ CREATE TABLE forum_posts (
# Table structure for table `forum_ratings`
#
-CREATE TABLE forum_ratings (
+CREATE TABLE prefix_forum_ratings (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0',
post integer NOT NULL default '0',
@@ -67,7 +67,7 @@ CREATE TABLE forum_ratings (
# Table structure for table `forum_subscriptions`
#
-CREATE TABLE forum_subscriptions (
+CREATE TABLE prefix_forum_subscriptions (
id SERIAL PRIMARY KEY,
userid integer NOT NULL default '0',
forum integer NOT NULL default '0'
@@ -78,14 +78,14 @@ CREATE TABLE forum_subscriptions (
# Dumping data for table `log_display`
#
-INSERT INTO log_display VALUES ('forum', 'add', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'update', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
-INSERT INTO log_display VALUES ('forum', 'add post', 'forum_posts', 'subject');
-INSERT INTO log_display VALUES ('forum', 'update post', 'forum_posts', 'subject');
-INSERT INTO log_display VALUES ('forum', 'view subscribers', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
-INSERT INTO log_display VALUES ('forum', 'view forum', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'subscribe', 'forum', 'name');
-INSERT INTO log_display VALUES ('forum', 'unsubscribe', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'add', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'update', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'add discussion', 'forum_discussions', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'add post', 'forum_posts', 'subject');
+INSERT INTO prefix_log_display VALUES ('forum', 'update post', 'forum_posts', 'subject');
+INSERT INTO prefix_log_display VALUES ('forum', 'view subscribers', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'view discussion', 'forum_discussions', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'view forum', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'subscribe', 'forum', 'name');
+INSERT INTO prefix_log_display VALUES ('forum', 'unsubscribe', 'forum', 'name');
@@ -14,7 +14,7 @@
# Table structure for table `journal`
#
-CREATE TABLE journal (
+CREATE TABLE prefix_journal (
id SERIAL PRIMARY KEY,
course integer NOT NULL default '0',
name varchar(255) default NULL,
@@ -29,7 +29,7 @@ CREATE TABLE journal (
# Table structure for table `journal_entries`
#
-CREATE TABLE journal_entries (
+CREATE TABLE prefix_journal_entries (
id SERIAL PRIMARY KEY,
journal integer NOT NULL default '0',
userid integer NOT NULL default '0',
@@ -47,7 +47,7 @@ CREATE TABLE journal_entries (
# Dumping data for table `log_display`
#
-INSERT INTO log_display VALUES ('journal', 'view', 'journal', 'name');
-INSERT INTO log_display VALUES ('journal', 'add entry', 'journal', 'name');
-INSERT INTO log_display VALUES ('journal', 'update entry', 'journal', 'name');
-INSERT INTO log_display VALUES ('journal', 'view responses', 'journal', 'name');
+INSERT INTO prefix_log_display VALUES ('journal', 'view', 'journal', 'name');
+INSERT INTO prefix_log_display VALUES ('journal', 'add entry', 'journal', 'name');
+INSERT INTO prefix_log_display VALUES ('journal', 'update entry', 'journal', 'name');
+INSERT INTO prefix_log_display VALUES ('journal', 'view responses', 'journal', 'name');
Oops, something went wrong.

0 comments on commit a3eea09

Please sign in to comment.