Remove reservation DB changes.

1.10.x
Julio Montoya 11 years ago
parent bdd85c56a8
commit 2f775125a0
  1. 114
      main/install/database.sql
  2. 22
      main/install/migrate-db-1.9.0-1.10.0-pre.sql

@ -1380,6 +1380,7 @@ CREATE TABLE IF NOT EXISTS gradebook_category (
generate_certificates TINYINT NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS gradebook_evaluation;
CREATE TABLE IF NOT EXISTS gradebook_evaluation (
id int unsigned NOT NULL auto_increment,
@ -1396,6 +1397,7 @@ CREATE TABLE IF NOT EXISTS gradebook_evaluation (
locked int NOT NULL DEFAULT 0,
PRIMARY KEY (id)
);
DROP TABLE IF EXISTS gradebook_link;
CREATE TABLE IF NOT EXISTS gradebook_link (
id int NOT NULL auto_increment,
@ -2355,116 +2357,6 @@ INSERT INTO system_template (title, comment, image, content) VALUES
</body>
');
--
-- --------------------------------------------------------
--
-- Tables for reservation
--
--
-- Table structure for table reservation category
--
DROP TABLE IF EXISTS reservation_category;
CREATE TABLE IF NOT EXISTS reservation_category (
id int unsigned NOT NULL auto_increment,
parent_id int NOT NULL default 0,
name varchar(128) NOT NULL default '',
PRIMARY KEY ( id )
);
--
-- Table structure for table reservation category_rights
--
DROP TABLE IF EXISTS reservation_category_rights;
CREATE TABLE IF NOT EXISTS reservation_category_rights (
id int unsigned NOT NULL auto_increment,
category_id int NOT NULL default 0,
class_id int NOT NULL default 0,
m_items tinyint NOT NULL default 0,
PRIMARY KEY ( id )
);
--
-- Table structure for table item reservation
--
DROP TABLE IF EXISTS reservation_item;
CREATE TABLE IF NOT EXISTS reservation_item (
id int unsigned NOT NULL auto_increment,
category_id int unsigned NOT NULL default 0,
course_code varchar(40) NOT NULL default '',
name varchar(128) NOT NULL default '',
description text NOT NULL,
blackout tinyint NOT NULL default 0,
creator int unsigned NOT NULL default 0,
always_available TINYINT NOT NULL default 0,
PRIMARY KEY ( id )
);
-- --------------------------------------------------------
--
-- Table structure for table reservation item_rights
--
DROP TABLE IF EXISTS reservation_item_rights;
CREATE TABLE IF NOT EXISTS reservation_item_rights (
item_id int unsigned NOT NULL default 0,
class_id int unsigned NOT NULL default 0,
edit_right tinyint unsigned NOT NULL default 0,
delete_right tinyint unsigned NOT NULL default 0,
m_reservation tinyint unsigned NOT NULL default 0,
view_right tinyint NOT NULL default 0,
PRIMARY KEY ( item_id , class_id )
);
-- --------------------------------------------------------
--
-- Table structure for main reservation table
--
DROP TABLE IF EXISTS reservation_main;
CREATE TABLE IF NOT EXISTS reservation_main (
id int unsigned NOT NULL auto_increment,
subid int unsigned NOT NULL default 0,
item_id int unsigned NOT NULL default 0,
auto_accept tinyint unsigned NOT NULL default 0,
max_users int unsigned NOT NULL default 1,
start_at datetime NOT NULL default '0000-00-00 00:00:00',
end_at datetime NOT NULL default '0000-00-00 00:00:00',
subscribe_from datetime NOT NULL default '0000-00-00 00:00:00',
subscribe_until datetime NOT NULL default '0000-00-00 00:00:00',
subscribers int unsigned NOT NULL default 0,
notes text NOT NULL,
timepicker tinyint NOT NULL default 0,
timepicker_min int NOT NULL default 0,
timepicker_max int NOT NULL default 0,
PRIMARY KEY ( id )
);
-- --------------------------------------------------------
--
-- Table structure for reservation subscription table
--
DROP TABLE IF EXISTS reservation_subscription;
CREATE TABLE IF NOT EXISTS reservation_subscription (
dummy int unsigned NOT NULL auto_increment,
user_id int unsigned NOT NULL default 0,
reservation_id int unsigned NOT NULL default 0,
accepted tinyint unsigned NOT NULL default 0,
start_at datetime NOT NULL default '0000-00-00 00:00:00',
end_at datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY ( dummy )
);
-- ---------------------------------------------------------
--
-- Table structure for table user_rel_user
--
@ -4727,5 +4619,5 @@ CREATE TABLE c_attendance_calendar_rel_group (
-- Version
LOCK TABLES settings_current WRITE;
UPDATE settings_current SET selected_value = '1.10.0.32' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.33' WHERE variable = 'chamilo_database_version';
UNLOCK TABLES;

@ -1,18 +1,8 @@
-- This script updates the databases structure before migrating the data from
-- version 1.9.0 (or version 1.9.*) to version 1.10.0
-- it is intended as a standalone script, however, because of the multiple
-- databases related difficulties, it should be parsed by a PHP script in
-- order to connect to and update the right databases.
-- There is one line per query, allowing the PHP function file() to read
-- all lines separately into an array. The xxMAINxx-type markers are there
-- to tell the PHP script which database we're talking about.
-- By always using the keyword "TABLE" in the queries, we should be able
-- to retrieve and modify the table name from the PHP script if needed, which
-- will allow us to deal with the unique-database-type installations
--
-- This first part is for the main database
-- xxMAINxx
-- Main DB changes
ALTER TABLE skill_rel_user ADD COLUMN course_id INT NOT NULL DEFAULT 0 AFTER id;
ALTER TABLE skill_rel_user ADD COLUMN session_id INT NOT NULL DEFAULT 0 AFTER course_id;
ALTER TABLE skill_rel_user ADD INDEX idx_select_cs (course_id, session_id);
@ -112,8 +102,9 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('enabled_ma
ALTER TABLE session MODIFY COLUMN name char(100) NOT NULL DEFAULT '';
ALTER TABLE track_e_default MODIFY COLUMN c_id int default NULL;
UPDATE course_field SET field_type = 1 WHERE field_variable = 'special_course';
-- xxCOURSExx
-- Course DB changes (c_*)
ALTER TABLE c_survey ADD COLUMN visible_results INT UNSIGNED DEFAULT 0;
ALTER TABLE c_survey_invitation ADD COLUMN group_id INT NOT NULL;
@ -130,7 +121,6 @@ CREATE TABLE IF NOT EXISTS c_student_publication_rel_user (id INT PRIMARY KEY N
CREATE TABLE IF NOT EXISTS c_student_publication_comment (id INT PRIMARY KEY NOT NULL AUTO_INCREMENT, work_id INT NOT NULL, c_id INT NOT NULL, comment text, file VARCHAR(255), user_id int NOT NULL, sent_at datetime NOT NULL);
CREATE TABLE IF NOT EXISTS c_attendance_calendar_rel_group (id int NOT NULL auto_increment PRIMARY KEY, c_id INT NOT NULL, group_id INT NOT NULL, calendar_id INT NOT NULL);
UPDATE course_field SET field_type = 1 WHERE field_variable = 'special_course';
-- Do not move this query
UPDATE settings_current SET selected_value = '1.10.0.32' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.33' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save