From: paca70 <paca70>
Date: Mon, 20 Sep 2004 17:48:19 +0000 (+0000)
Subject: 1. Postgres updates.
X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=be784d1a77a946e18dd96d355178e83ca0ae27e4;p=moodle.git

1. Postgres updates.
2. add log-values for mysql and postgres when creating new database.
 CVS: ----------------------------------------------------------------------
---

diff --git a/mod/attendance/db/mysql.sql b/mod/attendance/db/mysql.sql
index c559b9256b..ae70033f73 100755
--- a/mod/attendance/db/mysql.sql
+++ b/mod/attendance/db/mysql.sql
@@ -30,3 +30,7 @@ CREATE TABLE prefix_attendance_roll (
   notes varchar(64) NOT NULL default '',
   PRIMARY KEY  (id)
 ) TYPE=MyISAM;
+INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
+INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
+INSERT INTO prefix_log_display VALUES ('attendance', 'viewall', 'attendance', 'name');
+
diff --git a/mod/attendance/db/postgres7.php b/mod/attendance/db/postgres7.php
index 6f4af9fdb5..7d27bc55bf 100644
--- a/mod/attendance/db/postgres7.php
+++ b/mod/attendance/db/postgres7.php
@@ -18,6 +18,18 @@ function attendance_upgrade($oldversion) {
         table_column("attendance", "", "autoattend", "integer", 2, "unsigned", "0", "not null");
     }
 
+    if ($oldversion < 2004050301) {
+
+        modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'view', 'attendance', 'name');");
+
+        modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewall', 'attendance', 'name');");
+
+        modify_database("", "INSERT INTO {$CFG->prefix}log_display VALUES ('attendance', 'viewweek', 'attendance', 'name');");
+
+    }
+
+
+
     return true;
 }
 
diff --git a/mod/attendance/db/postgres7.sql b/mod/attendance/db/postgres7.sql
index 170336037c..2db7ff5689 100644
--- a/mod/attendance/db/postgres7.sql
+++ b/mod/attendance/db/postgres7.sql
@@ -3,14 +3,14 @@
 #
 
 CREATE TABLE prefix_attendance (
-  id SERIAL,
+  id SERIAL8,
   name varchar(255) NOT NULL default '',
-  course int4 NOT NULL default '0',
-  day int4 NOT NULL default '0',
+  course int8 NOT NULL default '0',
+  day int8 NOT NULL default '0',
   hours int2 NOT NULL default '0',
   roll int2 NOT NULL default '0',
   notes varchar(64) NOT NULL default '',
-  timemodified int4 NOT NULL default '0',
+  timemodified int8 NOT NULL default '0',
   dynsection int2 NOT NULL default '0',
   edited int2 NOT NULL default '0',
   autoattend int2 NOT NULL default '0',
@@ -22,11 +22,16 @@ CREATE TABLE prefix_attendance (
 #
 
 CREATE TABLE prefix_attendance_roll (
-  id SERIAL,
+  id SERIAL8,
   dayid int4 NOT NULL default '0',
-  userid int4 NOT NULL default '0',
+  userid int8 NOT NULL default '0',
   hour int2 NOT NULL default '0',
   status int4 NOT NULL default '0',
   notes varchar(64) NOT NULL default '',
   PRIMARY KEY  (id)
 );
+
+INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
+INSERT INTO prefix_log_display VALUES ('attendance', 'view', 'attendance', 'name');
+INSERT INTO prefix_log_display VALUES ('attendance', 'viewall', 'attendance', 'name');
+