alter table tl_mdchat10_session drop foreign key FKE2A598184D07F6E8;
alter table tl_mdchat10_user drop foreign key FK108B9589C7050F3F;
drop table if exists tl_mdchat10_configuration;
drop table if exists tl_mdchat10_mdlchat;
drop table if exists tl_mdchat10_session;
drop table if exists tl_mdchat10_user;
create table tl_mdchat10_configuration (uid bigint not null auto_increment, config_key varchar(30) unique, config_value varchar(255), primary key (uid));
create table tl_mdchat10_mdlchat (uid bigint not null auto_increment, create_date datetime, update_date datetime, define_later bit, content_in_use bit, run_offline bit, tool_content_id bigint, ext_tool_content_id bigint, ext_user_name varchar(255), ext_course_id varchar(255), ext_section varchar(255), primary key (uid));
create table tl_mdchat10_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, session_id bigint, ext_session_id bigint, session_name varchar(250), mdlChat_uid bigint, primary key (uid));
create table tl_mdchat10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), login_name varchar(255), first_name varchar(255), finishedActivity bit, mdlchat_session_uid bigint, entry_uid bigint, primary key (uid));
alter table tl_mdchat10_session add index FKE2A598184D07F6E8 (mdlChat_uid), add constraint FKE2A598184D07F6E8 foreign key (mdlChat_uid) references tl_mdchat10_mdlchat (uid);
alter table tl_mdchat10_user add index FK108B9589C7050F3F (mdlchat_session_uid), add constraint FK108B9589C7050F3F foreign key (mdlchat_session_uid) references tl_mdchat10_session (uid);
