alter table lams_text_search_condition drop foreign key FK69B884B21E70F543; alter table tl_lafrum11_attachment drop foreign key FK389AD9A2FE939F2A; alter table tl_lafrum11_attachment drop foreign key FK389AD9A2131CE31E; alter table tl_lafrum11_condition_topics drop foreign key FK98FF6A07E7FA664E; alter table tl_lafrum11_condition_topics drop foreign key FK98FF6A0749C49852; alter table tl_lafrum11_conditions drop foreign key FK7627B73781AF1E76; alter table tl_lafrum11_conditions drop foreign key FK7627B7373E8DC190; alter table tl_lafrum11_forum drop foreign key FK87917942E42F4351; alter table tl_lafrum11_forum_user drop foreign key FK7B83A4A85F0116B6; alter table tl_lafrum11_message drop foreign key FK4A6067E824089E4D; alter table tl_lafrum11_message drop foreign key FK4A6067E8647A7264; alter table tl_lafrum11_message drop foreign key FK4A6067E897F0DB46; alter table tl_lafrum11_message drop foreign key FK4A6067E8E42F4351; alter table tl_lafrum11_message drop foreign key FK4A6067E8FF5A1642; alter table tl_lafrum11_message drop foreign key FK4A6067E89357B45B; alter table tl_lafrum11_message drop foreign key FK4A6067E8131CE31E; alter table tl_lafrum11_message_rating drop foreign key FK704411D4B7BFD2E6; alter table tl_lafrum11_message_rating drop foreign key FK704411D4CDD2A765; alter table tl_lafrum11_message_seq drop foreign key FKD2C71F8845213B4D; alter table tl_lafrum11_message_seq drop foreign key FKD2C71F88FE939F2A; alter table tl_lafrum11_timestamp drop foreign key FK8D041CB79C21C011; alter table tl_lafrum11_timestamp drop foreign key FK8D041CB7FE939F2A; alter table tl_lafrum11_tool_session drop foreign key FK5A04D7AE131CE31E; drop table if exists lams_branch_condition; drop table if exists lams_text_search_condition; drop table if exists tl_lafrum11_attachment; drop table if exists tl_lafrum11_condition_topics; drop table if exists tl_lafrum11_conditions; drop table if exists tl_lafrum11_forum; drop table if exists tl_lafrum11_forum_user; drop table if exists tl_lafrum11_message; drop table if exists tl_lafrum11_message_rating; drop table if exists tl_lafrum11_message_seq; drop table if exists tl_lafrum11_report; drop table if exists tl_lafrum11_timestamp; drop table if exists tl_lafrum11_tool_session; create table lams_branch_condition (condition_id bigint not null auto_increment, condition_ui_id integer, order_id integer, name varchar(255), display_name varchar(255), type varchar(255), start_value varchar(255), end_value varchar(255), exact_match_value varchar(255), primary key (condition_id)); create table lams_text_search_condition (condition_id bigint not null, text_search_all_words varchar(255), text_search_phrase varchar(255), text_search_any_words varchar(255), text_search_excluded_words varchar(255), primary key (condition_id)); create table tl_lafrum11_attachment (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, forum_uid bigint, message_uid bigint, primary key (uid)); create table tl_lafrum11_condition_topics (condition_id bigint not null, topic_uid bigint not null, primary key (condition_id, topic_uid)); create table tl_lafrum11_conditions (condition_id bigint not null, content_uid bigint, primary key (condition_id)); create table tl_lafrum11_forum (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), allow_anonym bit, run_offline bit, lock_on_finished bit, instructions longtext, online_instructions longtext, offline_instructions longtext, content_in_use bit, define_later bit, content_id bigint unique, allow_edit bit, allow_rich_editor bit, limited_of_chars integer, limited_input_flag bit, allow_new_topic bit, allow_upload bit, allow_rate_messages bit, maximum_reply integer, minimum_reply integer, reflect_instructions varchar(255), reflect_on_activity bit, notify_learners_on_forum_posting bit, notify_teachers_on_forum_posting bit, mark_release_notify bit, submission_deadline datetime, primary key (uid)); create table tl_lafrum11_forum_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), session_id bigint, login_name varchar(255), session_finished bit, primary key (uid)); create table tl_lafrum11_message (uid bigint not null auto_increment, create_date datetime, last_reply_date datetime, update_date datetime, create_by bigint, modified_by bigint, subject varchar(255), body longtext, sequence_id integer, is_authored bit, is_anonymous bit, forum_session_uid bigint, parent_uid bigint, forum_uid bigint, reply_number integer, hide_flag bit, report_id bigint, authored_parent_uid bigint, primary key (uid)); create table tl_lafrum11_message_rating (uid bigint not null auto_increment, user_id bigint, rating float, message_id bigint, primary key (uid)); create table tl_lafrum11_message_seq (uid bigint not null auto_increment, root_message_uid bigint, message_uid bigint, message_level smallint, primary key (uid)); create table tl_lafrum11_report (uid bigint not null auto_increment, comment longtext, release_date datetime, mark float, primary key (uid)); create table tl_lafrum11_timestamp (uid bigint not null auto_increment, timestamp_date datetime, forum_user_uid bigint, message_uid bigint, primary key (uid)); create table tl_lafrum11_tool_session (uid bigint not null auto_increment, version integer not null, session_end_date datetime, session_start_date datetime, status integer, forum_uid bigint, session_id bigint, session_name varchar(250), mark_released bit, primary key (uid)); alter table lams_text_search_condition add index FK69B884B21E70F543 (condition_id), add constraint FK69B884B21E70F543 foreign key (condition_id) references lams_branch_condition (condition_id); alter table tl_lafrum11_attachment add index FK389AD9A2FE939F2A (message_uid), add constraint FK389AD9A2FE939F2A foreign key (message_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_attachment add index FK389AD9A2131CE31E (forum_uid), add constraint FK389AD9A2131CE31E foreign key (forum_uid) references tl_lafrum11_forum (uid); alter table tl_lafrum11_condition_topics add index FK98FF6A07E7FA664E (condition_id), add constraint FK98FF6A07E7FA664E foreign key (condition_id) references tl_lafrum11_conditions (condition_id); alter table tl_lafrum11_condition_topics add index FK98FF6A0749C49852 (topic_uid), add constraint FK98FF6A0749C49852 foreign key (topic_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_conditions add index FK7627B73781AF1E76 (content_uid), add constraint FK7627B73781AF1E76 foreign key (content_uid) references tl_lafrum11_forum (uid); alter table tl_lafrum11_conditions add index FK7627B7373E8DC190 (condition_id), add constraint FK7627B7373E8DC190 foreign key (condition_id) references lams_text_search_condition (condition_id); alter table tl_lafrum11_forum add index FK87917942E42F4351 (create_by), add constraint FK87917942E42F4351 foreign key (create_by) references tl_lafrum11_forum_user (uid); alter table tl_lafrum11_forum_user add index FK7B83A4A85F0116B6 (session_id), add constraint FK7B83A4A85F0116B6 foreign key (session_id) references tl_lafrum11_tool_session (uid); alter table tl_lafrum11_message add index FK4A6067E824089E4D (parent_uid), add constraint FK4A6067E824089E4D foreign key (parent_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_message add index FK4A6067E8647A7264 (modified_by), add constraint FK4A6067E8647A7264 foreign key (modified_by) references tl_lafrum11_forum_user (uid); alter table tl_lafrum11_message add index FK4A6067E897F0DB46 (report_id), add constraint FK4A6067E897F0DB46 foreign key (report_id) references tl_lafrum11_report (uid); alter table tl_lafrum11_message add index FK4A6067E8E42F4351 (create_by), add constraint FK4A6067E8E42F4351 foreign key (create_by) references tl_lafrum11_forum_user (uid); alter table tl_lafrum11_message add index FK4A6067E8FF5A1642 (authored_parent_uid), add constraint FK4A6067E8FF5A1642 foreign key (authored_parent_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_message add index FK4A6067E89357B45B (forum_session_uid), add constraint FK4A6067E89357B45B foreign key (forum_session_uid) references tl_lafrum11_tool_session (uid); alter table tl_lafrum11_message add index FK4A6067E8131CE31E (forum_uid), add constraint FK4A6067E8131CE31E foreign key (forum_uid) references tl_lafrum11_forum (uid); alter table tl_lafrum11_message_rating add index FK704411D4B7BFD2E6 (user_id), add constraint FK704411D4B7BFD2E6 foreign key (user_id) references tl_lafrum11_forum_user (uid); alter table tl_lafrum11_message_rating add index FK704411D4CDD2A765 (message_id), add constraint FK704411D4CDD2A765 foreign key (message_id) references tl_lafrum11_message (uid); alter table tl_lafrum11_message_seq add index FKD2C71F8845213B4D (root_message_uid), add constraint FKD2C71F8845213B4D foreign key (root_message_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_message_seq add index FKD2C71F88FE939F2A (message_uid), add constraint FKD2C71F88FE939F2A foreign key (message_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_timestamp add index FK8D041CB79C21C011 (forum_user_uid), add constraint FK8D041CB79C21C011 foreign key (forum_user_uid) references tl_lafrum11_forum_user (uid); alter table tl_lafrum11_timestamp add index FK8D041CB7FE939F2A (message_uid), add constraint FK8D041CB7FE939F2A foreign key (message_uid) references tl_lafrum11_message (uid); alter table tl_lafrum11_tool_session add index FK5A04D7AE131CE31E (forum_uid), add constraint FK5A04D7AE131CE31E foreign key (forum_uid) references tl_lafrum11_forum (uid);