[svn r15345] Last structure change before release, to integrate repeated calendar events scheduled for 1.8.5 a long time ago :-/ - see FS#2204

skala
Yannick Warnier 18 years ago
parent 53ac9a4a3a
commit 7d45882692
  1. 20
      main/inc/lib/add_course.lib.inc.php
  2. 6
      main/inc/lib/database.lib.php
  3. 13
      main/install/dokeos_user.sql
  4. 6
      main/install/migrate-db-1.8.4-1.8.5-pre.sql

@ -289,6 +289,8 @@ function update_Db_course($courseDbName)
$TABLETOOLCOURSEDESC = $courseDbName . "course_description";
$TABLETOOLAGENDA = $courseDbName . "calendar_event";
$TABLETOOLAGENDAREPEAT = $courseDbName . "calendar_event_repeat";
$TABLETOOLAGENDAREPEATNOT = $courseDbName . "calendar_event_repeat_not";
// Announcements
$TABLETOOLANNOUNCEMENTS = $courseDbName . "announcement";
@ -680,6 +682,24 @@ function update_Db_course($courseDbName)
)";
api_sql_query($sql, __FILE__, __LINE__);
$sql = "
CREATE TABLE `".$TABLETOOLAGENDAREPEAT. "` (
cal_id INT DEFAULT 0 NOT NULL,
cal_type VARCHAR(20),
cal_end INT,
cal_frequency INT DEFAULT 1,
cal_days CHAR(7),
PRIMARY KEY (cal_id)
)";
api_sql_query($sql,__FILE__,__LINE__);
$sql = "
CREATE TABLE `".$TABLETOOLAGENDAREPEATNOT."` (
cal_id INT NOT NULL,
cal_date INT NOT NULL,
PRIMARY KEY ( cal_id, cal_date )
)";
api_sql_query($sql,__FILE__,__LINE__);
/*
-----------------------------------------------------------
Document tool

@ -1,4 +1,4 @@
<?php // $Id: database.lib.php 15309 2008-05-18 22:57:12Z yannoo $
<?php // $Id: database.lib.php 15345 2008-05-21 06:04:40Z yannoo $
/* See license terms in /dokeos_license.txt */
/**
==============================================================================
@ -74,6 +74,8 @@ define('TABLE_SCORM_SCO_DATA', 'scorm_sco_data');
//course tables
define('TABLE_AGENDA', 'calendar_event');
define('TABLE_AGENDA_REPEAT', 'calendar_event_repeat');
define('TABLE_AGENDA_REPEAT_NOT', 'calendar_event_repeat_not');
define('TABLE_ANNOUNCEMENT', 'announcement');
define('TABLE_CHAT_CONNECTED', 'chat_connected'); // @todo: probably no longer in use !!!
define('TABLE_COURSE_DESCRIPTION', 'course_description');
@ -153,6 +155,8 @@ define('TABLE_ONLINE_LINK', 'online_link');
define('TABLE_ONLINE_CONNECTED', 'online_connected');
// dokeos_user database
define('TABLE_PERSONAL_AGENDA', 'personal_agenda');
define('TABLE_PERSONAL_AGENDA_REPEAT', 'personal_agenda_repeat');
define('TABLE_PERSONAL_AGENDA_REPEAT_NOT', 'personal_agenda_repeat_not');
define('TABLE_USER_COURSE_CATEGORY', 'user_course_category');
//Survey
// @todo: are these MAIN tables or course tables ?

@ -18,7 +18,20 @@ CREATE TABLE personal_agenda (
course varchar(255),
UNIQUE KEY id (id)
);
CREATE TABLE personal_agenda_repeat (
cal_id INT DEFAULT 0 NOT NULL,
cal_type VARCHAR(20),
cal_end INT,
cal_frequency INT DEFAULT 1,
cal_days CHAR(7),
PRIMARY KEY (cal_id)
);
CREATE TABLE personal_agenda_repeat_not (
cal_id INT NOT NULL,
cal_date INT NOT NULL,
PRIMARY KEY ( cal_id, cal_date )
);
CREATE TABLE user_course_category (
id int unsigned NOT NULL auto_increment,
user_id int unsigned NOT NULL default 0,

@ -119,6 +119,8 @@ ALTER TABLE track_e_uploads ADD INDEX (upload_cours_id);
ALTER TABLE track_e_attempt ADD tms datetime not null default '0000-00-00 00:00:00';
-- xxUSERxx
CREATE TABLE personal_agenda_repeat (cal_id INT DEFAULT 0 NOT NULL, cal_type VARCHAR(20), cal_end INT, cal_frequency INT DEFAULT 1, cal_days CHAR(7), PRIMARY KEY (cal_id));
CREATE TABLE personal_agenda_repeat_not (cal_id INT NOT NULL, cal_date INT NOT NULL, PRIMARY KEY ( cal_id, cal_date ));
-- xxCOURSExx
CREATE TABLE lp_iv_objective(id bigint unsigned primary key auto_increment, lp_iv_id bigint unsigned not null, order_id smallint unsigned not null default 0, objective_id varchar(255) not null default '', score_raw float unsigned not null default 0, score_max float unsigned not null default 0, score_min float unsigned not null default 0, status char(32) not null default 'not attempted');
@ -147,4 +149,6 @@ UPDATE tool SET category='interaction', admin='0', visibility='1' WHERE name='su
CREATE TABLE forum_notification (user_id int(11) , forum_id varchar(11), thread_id varchar(11), post_id varchar(11), KEY user_id (user_id), KEY forum_id (forum_id));
ALTER TABLE quiz ADD access_condition text DEFAULT NULL;
ALTER TABLE survey ADD access_condition text DEFAULT NULL;
UPDATE tool SET category='authoring' WHERE name = 'announcement';
UPDATE tool SET category='authoring' WHERE name = 'announcement';
CREATE TABLE calendar_event_repeat (cal_id INT DEFAULT 0 NOT NULL, cal_type VARCHAR(20), cal_end INT, cal_frequency INT DEFAULT 1, cal_days CHAR(7), PRIMARY KEY (cal_id));
CREATE TABLE calendar_event_repeat_not (cal_id INT NOT NULL, cal_date INT NOT NULL, PRIMARY KEY ( cal_id, cal_date ));
Loading…
Cancel
Save