alter table tl_mdwiki10_session drop foreign key FK95FFA8C9AE31EDB7;
alter table tl_mdwiki10_user drop foreign key FKA675AA78DC83E94C;
drop table if exists tl_mdwiki10_configuration;
drop table if exists tl_mdwiki10_mdlwiki;
drop table if exists tl_mdwiki10_session;
drop table if exists tl_mdwiki10_user;
create table tl_mdwiki10_configuration (uid bigint not null auto_increment, config_key varchar(30) unique, config_value varchar(255), primary key (uid));
create table tl_mdwiki10_mdlwiki (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_mdwiki10_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), mdlWiki_uid bigint, primary key (uid));
create table tl_mdwiki10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), login_name varchar(255), first_name varchar(255), finishedActivity bit, mdlwiki_session_uid bigint, entry_uid bigint, primary key (uid));
alter table tl_mdwiki10_session add index FK95FFA8C9AE31EDB7 (mdlWiki_uid), add constraint FK95FFA8C9AE31EDB7 foreign key (mdlWiki_uid) references tl_mdwiki10_mdlwiki (uid);
alter table tl_mdwiki10_user add index FKA675AA78DC83E94C (mdlwiki_session_uid), add constraint FKA675AA78DC83E94C foreign key (mdlwiki_session_uid) references tl_mdwiki10_session (uid);
