migrate-db-1.9.0-1.10.0-pre.sql 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. -- This script updates the databases structure before migrating the data from
  2. -- version 1.9.0 (or version 1.9.*) to version 1.10.0
  3. -- it is intended as a standalone script, however, because of the multiple
  4. -- databases related difficulties, it should be parsed by a PHP script in
  5. -- order to connect to and update the right databases.
  6. -- There is one line per query, allowing the PHP function file() to read
  7. -- all lines separately into an array. The xxMAINxx-type markers are there
  8. -- to tell the PHP script which database we're talking about.
  9. -- By always using the keyword "TABLE" in the queries, we should be able
  10. -- to retrieve and modify the table name from the PHP script if needed, which
  11. -- will allow us to deal with the unique-database-type installations
  12. --
  13. -- This first part is for the main database
  14. -- xxMAINxx
  15. ALTER TABLE skill_rel_user ADD COLUMN course_id INT NOT NULL DEFAULT 0 AFTER id;
  16. ALTER TABLE skill_rel_user ADD COLUMN session_id INT NOT NULL DEFAULT 0 AFTER course_id;
  17. ALTER TABLE skill_rel_user ADD INDEX idx_select_cs (course_id, session_id);
  18. 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));
  19. 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));
  20. 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));
  21. ALTER TABLE session ADD COLUMN description TEXT DEFAULT NULL;
  22. ALTER TABLE session ADD COLUMN show_description TINYINT UNSIGNED DEFAULT 0 AFTER description;
  23. ALTER TABLE session_rel_course ADD COLUMN position int NOT NULL default 0;
  24. ALTER TABLE session_rel_course ADD COLUMN category varchar(255) default '';
  25. ALTER TABLE session ADD COLUMN duration int;
  26. ALTER TABLE session_rel_user ADD COLUMN duration int;
  27. -- Do not move this query
  28. UPDATE settings_current SET selected_value = '1.10.0.5' WHERE variable = 'chamilo_database_version';
  29. -- xxCOURSExx
  30. ALTER TABLE c_survey ADD visible_results INT UNSIGNED DEFAULT 0;