Fix database install and upgrade codes for hooks - refs BT#9092

1.10.x
Yannick Warnier 10 years ago
parent bedb3b01e9
commit 566f708571
  1. 10
      main/install/db_main.sql
  2. 6
      main/install/migrate-db-1.9.0-1.10.0-pre.sql

@ -877,7 +877,7 @@ VALUES
('tool_visible_by_default_at_creation','forums','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Forums', 1),
('tool_visible_by_default_at_creation','quiz','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Quiz', 1),
('tool_visible_by_default_at_creation','gradebook','checkbox','Tools','true','ToolVisibleByDefaultAtCreationTitle','ToolVisibleByDefaultAtCreationComment',NULL,'Gradebook', 1),
('chamilo_database_version', NULL, 'textfield',NULL, '1.10.0.1','DatabaseVersion','', NULL, NULL, 0);
('chamilo_database_version', NULL, 'textfield',NULL, '1.10.0.2','DatabaseVersion','', NULL, NULL, 0);
UNLOCK TABLES;
/*!40000 ALTER TABLE settings_current ENABLE KEYS */;
@ -3029,6 +3029,10 @@ CREATE TABLE usergroup_rel_question (
coefficient float(6,2)
);
-- 1.10.x-specific, non-course-related, database changes
-- some changes to previous structure might have been applied to the tables
-- creation statements above to increase efficiency
-- Hook tables
CREATE TABLE IF NOT EXISTS hook_observer(
id int UNSIGNED NOT NULL AUTO_INCREMENT,
@ -3052,6 +3056,4 @@ CREATE TABLE IF NOT EXISTS hook_call(
enabled tinyint NOT NULL,
PRIMARY KEY PK_hook_management_hook_call(id)
);
-- 1.10.x-specific, non-course-related, database changes
-- some changes to previous structure might have been applied to the tables
-- creation statements above to increase efficiency

@ -17,10 +17,12 @@ 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);
CREATE TABLE IF NOT EXISTS hook_observer( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, path varchar(255) NOT NULL, plugin_name varchar(255) NULL, PRIMARY KEY PK_hook_management_hook_observer(id));
CREATE TABLE IF NOT EXISTS hook_event( id int UNSIGNED NOT NULL AUTO_INCREMENT, class_name varchar(255) UNIQUE, description varchar(255), PRIMARY KEY PK_hook_management_hook_event(id));
CREATE TABLE IF NOT EXISTS hook_call( id int UNSIGNED NOT NULL AUTO_INCREMENT, hook_event_id int UNSIGNED NOT NULL, hook_observer_id int UNSIGNED NOT NULL, type tinyint NOT NULL, hook_order int UNSIGNED NOT NULL, enabled tinyint NOT NULL, PRIMARY KEY PK_hook_management_hook_call(id));
-- Do not move this query
UPDATE settings_current SET selected_value = '1.10.0.1' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.2' WHERE variable = 'chamilo_database_version';
-- xxCOURSExx

Loading…
Cancel
Save