Replacing smallint with int

skala
Julio Montoya 12 years ago
parent 09ca71bbeb
commit ce64be13d1
  1. 21
      main/install/db_main.sql
  2. 26
      main/install/db_stats.sql
  3. 13
      main/install/migrate-db-1.9.0-1.10.0-pre.sql

@ -46,7 +46,7 @@ CREATE TABLE IF NOT EXISTS user (
active tinyint unsigned NOT NULL default 1,
openid varchar(255) DEFAULT NULL,
theme varchar(255) DEFAULT NULL,
hr_dept_id smallint unsigned NOT NULL default 0,
hr_dept_id int unsigned NOT NULL default 0,
PRIMARY KEY (user_id),
UNIQUE KEY username (username)
);
@ -466,12 +466,12 @@ CREATE TABLE IF NOT EXISTS php_session (
--
DROP TABLE IF EXISTS session;
CREATE TABLE IF NOT EXISTS session (
id MEDIUMINT unsigned NOT NULL auto_increment,
id INT unsigned NOT NULL auto_increment,
id_coach int unsigned NOT NULL default '0',
name char(150) NOT NULL default '',
nbr_courses smallint unsigned NOT NULL default '0',
nbr_users mediumint unsigned NOT NULL default '0',
nbr_classes mediumint unsigned NOT NULL default '0',
nbr_courses int unsigned NOT NULL default '0',
nbr_users int unsigned NOT NULL default '0',
nbr_classes int unsigned NOT NULL default '0',
session_admin_id INT UNSIGNED NOT NULL,
visibility int NOT NULL default 1,
session_category_id int NOT NULL,
@ -496,10 +496,11 @@ ALTER TABLE session ADD INDEX idx_id_session_admin_id (session_admin_id);
--
DROP TABLE IF EXISTS session_rel_course;
CREATE TABLE IF NOT EXISTS session_rel_course (
id_session MEDIUMINT unsigned NOT NULL default '0',
course_id INT NOT NULL default '0',
nbr_users smallint unsigned NOT NULL default '0',
PRIMARY KEY (id_session, course_id)
id_session INT unsigned NOT NULL default '0',
course_id INT NOT NULL default '0',
course_code char(40),
nbr_users int unsigned NOT NULL default '0',
PRIMARY KEY (id_session, course_id)
);
ALTER TABLE session_rel_course ADD INDEX idx_session_rel_course_course_id (course_id);
@ -3149,4 +3150,4 @@ CREATE TABLE branch_transaction (
);
-- Do not move this
UPDATE settings_current SET selected_value = '1.10.0.21272' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.21309' WHERE variable = 'chamilo_database_version';

@ -109,7 +109,7 @@ CREATE TABLE track_e_exercices (
exe_user_id int unsigned default NULL,
exe_date datetime NOT NULL default '0000-00-00 00:00:00',
exe_cours_id varchar(40) NOT NULL default '',
exe_exo_id mediumint unsigned NOT NULL default 0,
exe_exo_id int unsigned NOT NULL default 0,
exe_result float(6,2) NOT NULL default 0,
exe_weighting float(6,2) NOT NULL default 0,
PRIMARY KEY (exe_id),
@ -121,7 +121,7 @@ ALTER TABLE track_e_exercices ADD status varchar(20) NOT NULL default '';
ALTER TABLE track_e_exercices ADD data_tracking text NOT NULL default '';
ALTER TABLE track_e_exercices ADD start_date datetime NOT NULL default '0000-00-00 00:00:00';
ALTER TABLE track_e_exercices ADD steps_counter SMALLINT UNSIGNED NOT NULL default 0;
ALTER TABLE track_e_exercices ADD session_id SMALLINT UNSIGNED NOT NULL default 0;
ALTER TABLE track_e_exercices ADD session_id INT UNSIGNED NOT NULL default 0;
ALTER TABLE track_e_exercices ADD INDEX ( session_id ) ;
ALTER TABLE track_e_exercices ADD orig_lp_id int NOT NULL default 0;
ALTER TABLE track_e_exercices ADD orig_lp_item_id int NOT NULL default 0;
@ -146,18 +146,18 @@ CREATE TABLE track_e_attempt (
filename VARCHAR(255) DEFAULT NULL
);
ALTER TABLE track_e_attempt ADD INDEX (exe_id);
ALTER TABLE track_e_attempt ADD INDEX (user_id);
ALTER TABLE track_e_attempt ADD INDEX (user_id);
ALTER TABLE track_e_attempt ADD INDEX (question_id);
ALTER TABLE track_e_attempt ADD INDEX (session_id);
DROP TABLE IF EXISTS track_e_attempt_recording;
CREATE TABLE track_e_attempt_recording (
id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
exe_id int unsigned NOT NULL,
question_id int unsigned NOT NULL,
marks int NOT NULL,
insert_date datetime NOT NULL default '0000-00-00 00:00:00',
author int unsigned NOT NULL,
exe_id int unsigned NOT NULL,
question_id int unsigned NOT NULL,
marks int NOT NULL,
insert_date datetime NOT NULL default '0000-00-00 00:00:00',
author int unsigned NOT NULL,
teacher_comment text NOT NULL,
session_id INT NOT NULL DEFAULT 0
);
@ -291,9 +291,9 @@ ALTER TABLE track_e_online ADD INDEX (session_id);
ALTER TABLE track_e_online ADD INDEX idx_trackonline_uat (login_user_id, access_url_id, login_date);
ALTER TABLE track_e_item_property ADD INDEX (course_id, item_property_id, session_id);
ALTER TABLE track_e_downloads ADD INDEX (down_session_id);
ALTER TABLE track_e_links ADD INDEX (links_session_id);
ALTER TABLE track_e_uploads ADD INDEX (upload_session_id);
ALTER TABLE track_e_downloads ADD INDEX (down_session_id);
ALTER TABLE track_e_links ADD INDEX (links_session_id);
ALTER TABLE track_e_uploads ADD INDEX (upload_session_id);
--
-- Table structure for LP custom storage API
@ -305,7 +305,7 @@ CREATE TABLE IF NOT EXISTS track_stored_values (
sco_id INT NOT NULL,
course_id CHAR(40) NOT NULL,
sv_key CHAR(64) NOT NULL,
sv_value TEXT NOT NULL
sv_value TEXT NOT NULL
);
ALTER TABLE track_stored_values ADD KEY (user_id, sco_id, course_id, sv_key);
ALTER TABLE track_stored_values ADD UNIQUE (user_id, sco_id, course_id, sv_key);
@ -326,6 +326,6 @@ ALTER TABLE track_stored_values_stack ADD UNIQUE (user_id, sco_id, course_id, sv
DROP TABLE IF EXISTS track_e_attempt_coeff;
CREATE TABLE track_e_attempt_coeff (
id int unsigned not null auto_increment primary key,
attempt_id INT NOT NULL,
attempt_id INT NOT NULL,
marks_coeff float(6,2)
);

@ -121,5 +121,16 @@ ALTER TABLE c_lp ADD COLUMN max_attempts INT 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));
ALTER TABLE user MODIFY COLUMN hr_dept_id int unsigned NOT NULL default 0;
ALTER TABLE session MODIFY COLUMN id INT unsigned NOT NULL auto_increment;
ALTER TABLE session MODIFY COLUMN nbr_courses int unsigned NOT NULL default 0;
ALTER TABLE session MODIFY COLUMN nbr_users int unsigned NOT NULL default 0;
ALTER TABLE session MODIFY COLUMN nbr_classes int unsigned NOT NULL default 0;
ALTER TABLE session_rel_course MODIFY COLUMN nbr_users int unsigned NOT NULL default 0;
ALTER TABLE track_e_exercices MODIFY COLUMN session_id int unsigned NOT NULL default 0;
ALTER TABLE track_e_exercices MODIFY COLUMN exe_exo_id int unsigned NOT NULL default 0;
-- Do not move this
UPDATE settings_current SET selected_value = '1.10.0.21272' WHERE variable = 'chamilo_database_version';
UPDATE settings_current SET selected_value = '1.10.0.21309' WHERE variable = 'chamilo_database_version';
Loading…
Cancel
Save