Course ranking: adding SQL schema in migrate-db-1.8.8-1.9.0 see #4200

skala
Julio Montoya 13 years ago
parent 921688efc7
commit b7413bfc6b
  1. 10
      main/install/db_main.sql
  2. 15
      main/install/migrate-db-1.8.8-1.9.0-pre.sql

@ -2800,8 +2800,6 @@ CREATE TABLE skill_rel_user (
PRIMARY KEY (id)
);
CREATE TABLE skill_profile (
id INTEGER NOT NULL AUTO_INCREMENT,
name VARCHAR(255) NOT NULL,
@ -2817,6 +2815,7 @@ CREATE TABLE skill_rel_profile (
);
-- Course ranking
CREATE TABLE track_course_ranking (
id int unsigned not null PRIMARY KEY AUTO_INCREMENT,
@ -2834,7 +2833,7 @@ ALTER TABLE track_course_ranking ADD INDEX idx_tcc_sid (session_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_urlid (url_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_creation_date (creation_date);
CREATE TABLE user_rel_course_vote(
CREATE TABLE user_rel_course_vote (
id int unsigned not null AUTO_INCREMENT PRIMARY KEY,
c_id int unsigned not null,
user_id int unsigned not null,
@ -2845,7 +2844,4 @@ CREATE TABLE user_rel_course_vote(
ALTER TABLE user_course_vote ADD INDEX idx_ucv_cid (c_id);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_uid (user_id);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_cuid (user_id, c_id);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_cuid (user_id, c_id);

@ -136,6 +136,21 @@ INSERT INTO settings_options (variable, value, display_text) VALUES ('show_admin
INSERT INTO settings_options (variable, value, display_text) VALUES ('show_admin_toolbar', 'show_to_all', 'ShowToAllUsers');
-- Course ranking
CREATE TABLE track_course_ranking (id int unsigned not null PRIMARY KEY AUTO_INCREMENT,c_id int unsigned not null, session_id int unsigned not null default 0, url_id int unsigned not null default 0, accesses int unsigned not null default 0, total_score int unsigned not null default 0, users int unsigned not null default 0, creation_date datetime not null);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_cid (c_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_sid (session_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_urlid (url_id);
ALTER TABLE track_course_ranking ADD INDEX idx_tcc_creation_date (creation_date);
CREATE TABLE user_rel_course_vote ( id int unsigned not null AUTO_INCREMENT PRIMARY KEY, c_id int unsigned not null, user_id int unsigned not null, session_id int unsigned not null default 0, url_id int unsigned not null default 0, vote int unsigned not null default 0);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_cid (c_id);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_uid (user_id);
ALTER TABLE user_course_vote ADD INDEX idx_ucv_cuid (user_id, c_id);
-- Do not move this query
UPDATE settings_current SET selected_value = '1.9.0.16427' WHERE variable = 'chamilo_database_version';

Loading…
Cancel
Save