diff --git a/main/install/db_main.sql b/main/install/db_main.sql index d97dbcac32..569ebcafe0 100644 --- a/main/install/db_main.sql +++ b/main/install/db_main.sql @@ -3149,4 +3149,4 @@ CREATE TABLE branch_transaction ( ); -- Do not move this -UPDATE settings_current SET selected_value = '1.10.0.21196' WHERE variable = 'chamilo_database_version'; \ No newline at end of file +UPDATE settings_current SET selected_value = '1.10.0.21217' WHERE variable = 'chamilo_database_version'; \ No newline at end of file diff --git a/main/install/install.lib.php b/main/install/install.lib.php index 72deb75759..fec7d61ca1 100755 --- a/main/install/install.lib.php +++ b/main/install/install.lib.php @@ -2234,6 +2234,7 @@ function create_course_tables($course_db_name = null) { // New Learning path $TABLELP = $course_db_name . 'lp'; + $TABLE_LP_CATEGORY = $course_db_name . 'lp_category'; $TABLELPITEM = $course_db_name . 'lp_item'; $TABLELPVIEW = $course_db_name . 'lp_view'; $TABLELPITEMVIEW = $course_db_name . 'lp_item_view'; @@ -3203,11 +3204,21 @@ function create_course_tables($course_db_name = null) { "modified_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . "publicated_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . "expired_on DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', + category_id INT unsigned NOT NULL default 0, PRIMARY KEY (c_id, id) )" . $charset_clause; Database::query($sql); + $sql = "CREATE TABLE IF NOT EXISTS `$TABLE_LP_CATEGORY` ( + id int unsigned NOT NULL auto_increment, + $add_to_all_tables + name VARCHAR(255), + PRIMARY KEY (id) + )" . $charset_clause; + Database::query($sql); + + $sql = "CREATE TABLE IF NOT EXISTS `$TABLELPVIEW` ( $add_to_all_tables" . "id int unsigned auto_increment," . // unique ID from MySQL diff --git a/main/install/migrate-db-1.9.0-1.10.0-pre.sql b/main/install/migrate-db-1.9.0-1.10.0-pre.sql index fa3351b6b0..fce68faa7f 100755 --- a/main/install/migrate-db-1.9.0-1.10.0-pre.sql +++ b/main/install/migrate-db-1.9.0-1.10.0-pre.sql @@ -116,5 +116,8 @@ ALTER TABLE course_module change `column` column_module int unsigned NOT NULL de ALTER TABLE c_survey_invitation ADD COLUMN group_id INT NOT NULL DEFAULT 0; +ALTER TABLE c_lp ADD COLUMN category_id INT unsigned NOT NULL default 0; +CREATE TABLE c_lp_category (id int unsigned NOT NULL auto_increment, c_id INT unsigned NOT NULL, name VARCHAR(255), PRIMARY KEY (id)); + -- Do not move this -UPDATE settings_current SET selected_value = '1.10.0.21196' WHERE variable = 'chamilo_database_version'; \ No newline at end of file +UPDATE settings_current SET selected_value = '1.10.0.21217' WHERE variable = 'chamilo_database_version'; \ No newline at end of file