[svn r10618] Finished first cycle of preparations

skala
Yannick Warnier 18 years ago
parent 2773e96680
commit 47b0392d9e
  1. 88
      main/install/migrate-db-1.6.x-1.8.0-post.sql
  2. 113
      main/install/migrate-db-1.6.x-1.8.0-pre.sql

@ -12,109 +12,27 @@
-- This first part is for the main database
-- xxMAINxx
ALTER TABLE admin SET COLUMN user_id Default
ALTER TABLE class_user SET COLUMN class_id Default
ALTER TABLE class_user SET COLUMN user_id Default
ALTER TABLE course ADD COLUMN registration_code...
ALTER TABLE course_rel_class SET COLUMN class_id Default
CREATE TABLE course_rel_survey();
ALTER TABLE course_rel_user SET COLUMN user_id Default
CREATE TABLE messages();
CREATE TABLE sess();
ALTER TABLE session DROP COLUMN sess_id
ALTER TABLE session DROP COLUMN sess_name
ALTER TABLE session DROP COLUMN sess_time
ALTER TABLE session DROP COLUMN sess_start
ALTER TABLE session DROP COLUMN sess_value
ALTER TABLE session ADD COLUMN id...
ALTER TABLE session ADD COLUMN id_coach...
ALTER TABLE session ADD COLUMN name...
ALTER TABLE session ADD COLUMN nbr_courses...
ALTER TABLE session ADD COLUMN nbr_users...
ALTER TABLE session ADD COLUMN nbr_classes...
ALTER TABLE session ADD COLUMN date_start...
ALTER TABLE session ADD COLUMN date_end...
CREATE TABLE session_rel_course();
CREATE TABLE session_rel_course_rel_user();
CREATE TABLE session_rel_user();
CREATE TABLE survey_reminder();
CREATE TABLE survey_user_info();
ALTER TABLE sys_announcement SET COLUMN visible_teacher Type
ALTER TABLE sys_announcement SET COLUMN visible_student Type
ALTER TABLE sys_announcement SET COLUMN visible_guest Type
ALTER TABLE sys_announcement ADD COLUMN lang...
ALTER TABLE user SET COLUMN auth_source Default
ALTER TABLE user ADD COLUMN language...
ALTER TABLE user ADD COLUMN registration_date...
ALTER TABLE user ADD COLUMN expiration_date...
ALTER TABLE user ADD COLUMN active...
-- xxSTATSxx
CREATE TABLE track_e_attempt();
CREATE TABLE track_e_course_access();
ALTER TABLE track_e_lastaccess SET COLUMN access_id Type
ALTER TABLE track_e_lastaccess ADD COLUMN access_session_id...
ALTER TABLE track_e_login ADD COLUMN logout_date...
ALTER TABLE track_e_online ADD COLUMN course...
-- xxUSERxx
ALTER TABLE user_course_category ADD COLUMN sort...
-- xxSCORMxx
DROP TABLE scorm_main();
DROP TABLE scorm_sco_data();
-- xxCOURSExx
ALTER TABLE announcement SET COLUMN content Type
ALTER TABLE announcement ADD COLUMN email_sent...
CREATE TABLE audiorecorder();
CREATE TABLE blogs();
CREATE TABLE blogs_comments();
CREATE TABLE blogs_posts();
CREATE TABLE blogs_rating();
CREATE TABLE blogs_rel_user();
CREATE TABLE blogs_tasks();
CREATE TABLE blogs_tasks_rel_user();
CREATE TABLE course_setting();
CREATE TABLE dropbox_category();
CREATE TABLE dropbox_feedback();
CREATE TABLE forum_category();
CREATE TABLE forum_forum();
CREATE TABLE forum_mailcue();
CREATE TABLE forum_post();
CREATE TABLE forum_thread();
ALTER TABLE group_category DROP COLUMN forum_state
ALTER TABLE group_category ADD COLUMN calendar_state...
ALTER TABLE group_category ADD COLUMN work_state...
ALTER TABLE group_category ADD COLUMN announcements_state...
ALTER TABLE group_info DROP COLUMN tutor_id
ALTER TABLE group_info DROP COLUMN forum_state
ALTER TABLE group_info DROP COLUMN forum_id
ALTER TABLE group_info SET COLUMN secret_directory Type
ALTER TABLE group_info ADD COLUMN calendar_state...
ALTER TABLE group_info ADD COLUMN work_state...
ALTER TABLE group_info ADD COLUMN announcements_state...
CREATE TABLE group_rel_tutor();
CREATE TABLE lp();
CREATE TABLE lp_item();
CREATE TABLE lp_item_view();
CREATE TABLE lp_iv_interaction();
CREATE TABLE lp_view();
CREATE TABLE permission_group();
CREATE TABLE permission_task();
CREATE TABLE permission_user();
CREATE TABLE questions();
ALTER TABLE quiz_answer ADD COLUMN hotspot_coordinates...
ALTER TABLE quiz_answer ADD COLUMN hotspot_type...
CREATE TABLE role();
CREATE TABLE role_group();
CREATE TABLE role_permissions();
CREATE TABLE role_user();
ALTER TABLE student_publication ADD COLUMN post_group_id...
CREATE TABLE survey();
CREATE TABLE survey_group();
CREATE TABLE survey_report();
ALTER TABLE tool ADD COLUMN category...
DROP TABLE bb_access();
DROP TABLE bb_banlist();
DROP TABLE bb_categories();

@ -55,69 +55,56 @@ ALTER TABLE user_course_category ADD sort int;
-- xxCOURSExx
ALTER TABLE announcement CHANGE content content mediumtext;
ALTER TABLE announcement ADD email_sent tinyint;
CREATE TABLE blogs(blog_id smallint NOT NULL AUTO_INCREMENT , blog_name varchar(250) NOT NULL default '', blog_subtitle varchar( 250 ) default NULL , date_creation datetime NOT NULL default '0000-00-00 00:00:00', visibility enum( '0', '1' ) NOT NULL default '0', PRIMARY KEY (blog_id));
CREATE TABLE blogs_comments(comment_id int NOT NULL AUTO_INCREMENT , title varchar(250) NOT NULL default '', comment longtext NOT NULL , author_id int NOT NULL default '0', date_creation datetime NOT NULL default '0000-00-00 00:00:00', blog_id mediumint NOT NULL default '0', post_id int NOT NULL default '0', task_id int default NULL , parent_comment_id int NOT NULL default '0', PRIMARY KEY (comment_id));
CREATE TABLE blogs_posts();
CREATE TABLE blogs_rating();
CREATE TABLE blogs_rel_user();
CREATE TABLE blogs_tasks();
CREATE TABLE blogs_tasks_rel_user();
CREATE TABLE course_setting();
CREATE TABLE dropbox_category();
CREATE TABLE dropbox_feedback();
CREATE TABLE forum_category();
CREATE TABLE forum_forum();
CREATE TABLE forum_mailcue();
CREATE TABLE forum_post();
CREATE TABLE forum_thread();
ALTER TABLE group_category DROP COLUMN forum_state
ALTER TABLE group_category ADD COLUMN calendar_state...
ALTER TABLE group_category ADD COLUMN work_state...
ALTER TABLE group_category ADD COLUMN announcements_state...
ALTER TABLE group_info DROP COLUMN tutor_id
ALTER TABLE group_info DROP COLUMN forum_state
ALTER TABLE group_info DROP COLUMN forum_id
ALTER TABLE group_info SET COLUMN secret_directory Type
ALTER TABLE group_info ADD COLUMN calendar_state...
ALTER TABLE group_info ADD COLUMN work_state...
ALTER TABLE group_info ADD COLUMN announcements_state...
CREATE TABLE group_rel_tutor();
CREATE TABLE lp();
CREATE TABLE lp_item();
CREATE TABLE lp_item_view();
CREATE TABLE lp_iv_interaction();
CREATE TABLE lp_view();
CREATE TABLE permission_group();
CREATE TABLE permission_task();
CREATE TABLE permission_user();
CREATE TABLE blog(blog_id smallint NOT NULL AUTO_INCREMENT , blog_name varchar(250) NOT NULL default '', blog_subtitle varchar( 250 ) default NULL , date_creation datetime NOT NULL default '0000-00-00 00:00:00', visibility enum( '0', '1' ) NOT NULL default '0', PRIMARY KEY (blog_id));
CREATE TABLE blog_comment(comment_id int NOT NULL AUTO_INCREMENT , title varchar(250) NOT NULL default '', comment longtext NOT NULL , author_id int NOT NULL default '0', date_creation datetime NOT NULL default '0000-00-00 00:00:00', blog_id mediumint NOT NULL default '0', post_id int NOT NULL default '0', task_id int default NULL , parent_comment_id int NOT NULL default '0', PRIMARY KEY (comment_id));
CREATE TABLE blog_post(post_id int NOT NULL AUTO_INCREMENT, title varchar(250) NOT NULL default '', full_text longtext NOT NULL, date_creation datetime NOT NULL default '0000-00-00 00:00:00', blog_id mediumint NOT NULL default '0', author_id int NOT NULL default '0', PRIMARY KEY (post_id));
CREATE TABLE blog_rating(rating_id int NOT NULL AUTO_INCREMENT, blog_id int NOT NULL default '0', rating_type enum( 'post', 'comment' ) NOT NULL default 'post', item_id int NOT NULL default '0', user_id int NOT NULL default '0', rating mediumint NOT NULL default '0', PRIMARY KEY (rating_id));
CREATE TABLE blog_rel_user(blog_id int NOT NULL default '0', user_id int NOT NULL default '0', PRIMARY KEY (blog_id,user_id));
CREATE TABLE blog_task(task_id mediumint NOT NULL AUTO_INCREMENT,blog_id mediumint NOT NULL default '0',title varchar( 250 ) NOT NULL default '',description text NOT NULL ,color varchar( 10 ) NOT NULL default '', system_task enum( '0', '1' ) NOT NULL default '0',PRIMARY KEY (task_id));
CREATE TABLE blog_task_rel_user(blog_id mediumint NOT NULL default '0',user_id int NOT NULL default '0',task_id mediumint NOT NULL default '0',target_date date NOT NULL default '0000-00-00',PRIMARY KEY (blog_id,user_id,task_id));
CREATE TABLE course_setting(id int unsigned NOT NULL auto_increment, variable varchar(255) NOT NULL default '', value varchar(255) NOT NULL default '', tool_scope varchar(255) default '', PRIMARY KEY (id));
CREATE TABLE dropbox_category(cat_id int NOT NULL auto_increment, cat_name text NOT NULL, received enum('0','1') NOT NULL default '0', sent enum('0','1') NOT NULL default '0', user_id int NOT NULL default '0', PRIMARY KEY (cat_id));
CREATE TABLE dropbox_feedback(feedback_id int NOT NULL auto_increment, file_id int NOT NULL default '0', author_user_id int NOT NULL default '0', feedback text NOT NULL, feedback_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (feedback_id), KEY file_id (file_id), KEY author_user_id (author_user_id));
CREATE TABLE forum_category(cat_id int NOT NULL auto_increment, cat_title varchar(255) NOT NULL default '', cat_comment text, cat_order int(11) NOT NULL default '0', locked int(5) NOT NULL default '0', PRIMARY KEY (cat_id));
CREATE TABLE forum_forum(forum_id int NOT NULL auto_increment, forum_title varchar(255) NOT NULL default '', forum_comment text, forum_threads int default '0', forum_posts int default '0', forum_last_post int default '0', forum_category int default NULL, allow_anonymous int default NULL, allow_edit int default NULL, approval_direct_post varchar(20) default NULL, allow_attachments int default NULL, allow_new_threads int default NULL, default_view varchar(20) default NULL, forum_of_group varchar(20) default NULL, forum_group_public_private varchar(20) default 'public', forum_order int default NULL, locked int NOT NULL default '0', PRIMARY KEY (forum_id));
CREATE TABLE forum_mailcue(thread_id int default NULL, user_id int default NULL, post_id int default NULL);
CREATE TABLE forum_post(post_id int NOT NULL auto_increment, post_title varchar(250) default NULL, post_text text, thread_id int default '0', forum_id int default '0', poster_id int default '0', poster_name varchar(100) default '', post_date datetime default '0000-00-00 00:00:00', post_notification int default '0', post_parent_id int default '0', visible int default '1', PRIMARY KEY (post_id), KEY poster_id (poster_id), KEY forum_id (forum_id));
CREATE TABLE forum_thread(thread_id int NOT NULL auto_increment,thread_title varchar(255) default NULL, forum_id int default NULL, thread_replies int default '0', thread_poster_id int default NULL, thread_poster_name int default '0', thread_views int default '0', thread_last_post int default NULL, thread_date datetime default '0000-00-00 00:00:00', thread_sticky int default '0', locked int NOT NULL default '0', PRIMARY KEY (thread_id), KEY thread_id (thread_id));
ALTER TABLE group_category ADD COLUMN calendar_state tinyint unsigned NOT NULL default 1;
ALTER TABLE group_category ADD COLUMN work_state tinyint unsigned NOT NULL default 1;
ALTER TABLE group_category ADD COLUMN announcements_state tinyint unsigned NOT NULL default 1;
ALTER TABLE group_info MODIFY secret_directory varchar(255) default NULL;
ALTER TABLE group_info ADD COLUMN calendar_state tinyint unsigned NOT NULL default 0;
ALTER TABLE group_info ADD COLUMN work_state tinyint unsigned NOT NULL default 0;
ALTER TABLE group_info ADD COLUMN announcements_state tinyint unsigned NOT NULL default 0;
CREATE TABLE group_rel_tutor(id int NOT NULL auto_increment, user_id int NOT NULL, group_id int NOT NULL default 0, PRIMARY KEY (id));
CREATE TABLE lp(id int unsigned primary key auto_increment, lp_type smallint unsigned not null, name tinytext not null, ref tinytext null, description text null, path text not null, force_commit tinyint unsigned not null default 0, default_view_mod char(32) not null default 'embedded', default_encoding char(32) not null default 'ISO-8859-1', display_order int unsigned not null default 0, content_maker tinytext not null default '', content_local varchar(32) not null default 'local', content_license text not null default '', prevent_reinit tinyint unsigned not null default 1, js_lib tinytext not null default '', debug tinyint unsigned not null default 0);
CREATE TABLE lp_view(id int unsigned primary key auto_increment, lp_id int unsigned not null, user_id int unsigned not null, view_count smallint unsigned not null default 0, last_item int unsigned not null default 0, progress int unsigned default 0);
CREATE TABLE lp_item(id int unsigned primary key auto_increment, lp_id int unsigned not null, item_type char(32) not null default 'dokeos_document', ref tinytext not null default '', title tinytext not null, description tinytext not null default '', path text not null, min_score float unsigned not null default 0, max_score float unsigned not null default 100, mastery_score float unsigned null, parent_item_id int unsigned not null default 0, previous_item_id int unsigned not null default 0, next_item_id int unsigned not null default 0, display_order int unsigned not null default 0, prerequisite char(64) null, parameters text null, launch_data text not null default '');
CREATE TABLE lp_item_view(id bigint unsigned primary key auto_increment, lp_item_id int unsigned not null, lp_view_id int unsigned not null, view_count int unsigned not null default 0, start_time int unsigned not null, total_time int unsigned not null default 0, score float unsigned not null default 0, status char(32) not null default 'Not attempted', suspend_data text null default '', lesson_location text null default '');
CREATE TABLE lp_iv_interaction(id bigint unsigned primary key auto_increment, order_id smallint unsigned not null default 0, lp_iv_id bigint unsigned not null, interaction_id varchar(255) not null default '', interaction_type varchar(255) not null default '', weighting double not null default 0, completion_time varchar(16) not null default '', correct_responses text not null default '', student_response text not null default '', result varchar(255) not null default '', latency varchar(16) not null default '');
CREATE TABLE permission_group(id int NOT NULL AUTO_INCREMENT, group_id int NOT NULL default 0, tool varchar( 250 ) NOT NULL default '', action varchar( 250 ) NOT NULL default '', PRIMARY KEY ( id ));
CREATE TABLE permission_user(id int NOT NULL AUTO_INCREMENT, user_id int NOT NULL default 0, tool varchar( 250 ) NOT NULL default '', action varchar( 250 ) NOT NULL default '', PRIMARY KEY ( id ));
CREATE TABLE permission_task(id int NOT NULL AUTO_INCREMENT, task_id int NOT NULL default 0, tool varchar( 250 ) NOT NULL default '', action varchar( 250 ) NOT NULL default '', PRIMARY KEY ( id ));
CREATE TABLE questions();
ALTER TABLE quiz_answer ADD COLUMN hotspot_coordinates...
ALTER TABLE quiz_answer ADD COLUMN hotspot_type...
CREATE TABLE role();
CREATE TABLE role_group();
CREATE TABLE role_permissions();
CREATE TABLE role_user();
ALTER TABLE student_publication ADD COLUMN post_group_id...
CREATE TABLE survey();
CREATE TABLE survey_group();
CREATE TABLE survey_report();
ALTER TABLE tool ADD COLUMN category...
DROP TABLE bb_access();
DROP TABLE bb_banlist();
DROP TABLE bb_categories();
DROP TABLE bb_config();
DROP TABLE bb_disallow();
DROP TABLE bb_forum_access();
DROP TABLE bb_forum_mods();
DROP TABLE bb_forums();
DROP TABLE bb_headermetafooter();
DROP TABLE bb_posts();
DROP TABLE bb_posts_text();
DROP TABLE bb_priv_msgs();
DROP TABLE bb_ranks();
DROP TABLE bb_sessions();
DROP TABLE bb_themes();
DROP TABLE bb_topics();
DROP TABLE bb_users();
DROP TABLE bb_whosonline();
DROP TABLE bb_words();
CREATE TABLE role(role_id int NOT NULL AUTO_INCREMENT , role_name varchar( 250 ) NOT NULL default '', role_comment text, default_role tinyint default 0, PRIMARY KEY ( role_id ));
CREATE TABLE role_group(role_id int NOT NULL default 0, scope varchar( 20 ) NOT NULL default 'course', group_id int NOT NULL default 0);
CREATE TABLE role_permissions(role_id int NOT NULL default 0, tool varchar( 250 ) NOT NULL default '', action varchar( 50 ) NOT NULL default '', default_perm tinyint NOT NULL default 0);
CREATE TABLE role_user(role_id int NOT NULL default 0, scope varchar( 20 ) NOT NULL default 'course', user_id int NOT NULL default 0);
ALTER TABLE student_publication ADD COLUMN post_group_id int DEFAULT 0 NOT NULL;
CREATE TABLE survey(survey_id int unsigned NOT NULL auto_increment, code varchar(20) default NULL, title varchar(80) default NULL, subtitle varchar(80) default NULL, author varchar(20) default NULL, lang varchar(20) default NULL, avail_from date default NULL, avail_till date default NULL, is_shared char(1) default 1, template varchar(20) default NULL, intro text, surveythanks text, creation_date datetime NOT NULL default '0000-00-00 00:00:00', PRIMARY KEY (survey_id), UNIQUE KEY id (survey_id));
CREATE TABLE survey_group(group_id int NOT NULL auto_increment, survey_id int NOT NULL default 0, groupname varchar(100) NOT NULL default '', introduction text NOT NULL, imported_group int NOT NULL default 0, db_name varchar(100) NULL default '', sortby int NOT NULL default 1, PRIMARY KEY (group_id));
CREATE TABLE survey_report(id int NOT NULL auto_increment, qid int NOT NULL default 0, answer text NOT NULL, survey_id int NOT NULL default 0, user_id int NOT NULL default 0, PRIMARY KEY (id));
ALTER TABLE tool ADD COLUMN category enum('authoring','interaction','admin') NOT NULL default 'authoring';
Loading…
Cancel
Save