alter table tl_ladaco10_answer_options drop foreign key FK5382D798E57F91D7; alter table tl_ladaco10_answers drop foreign key AnswerToQuestion; alter table tl_ladaco10_answers drop foreign key AnswerToUser; alter table tl_ladaco10_attachments drop foreign key FKDF470D1590B362E4; alter table tl_ladaco10_contents drop foreign key DacoToUser; alter table tl_ladaco10_questions drop foreign key QuestionToDaco; alter table tl_ladaco10_questions drop foreign key FKCB5397F25DF01D03; alter table tl_ladaco10_questions drop foreign key QuestionToUser; alter table tl_ladaco10_sessions drop foreign key SessionToDaco; alter table tl_ladaco10_users drop foreign key UserToDaco; alter table tl_ladaco10_users drop foreign key UserToSession; drop table if exists tl_ladaco10_answer_options; drop table if exists tl_ladaco10_answers; drop table if exists tl_ladaco10_attachments; drop table if exists tl_ladaco10_contents; drop table if exists tl_ladaco10_questions; drop table if exists tl_ladaco10_sessions; drop table if exists tl_ladaco10_users; create table tl_ladaco10_answer_options (uid bigint not null auto_increment, sequence_num integer, answer_option varchar(255), question_uid bigint, primary key (uid)); create table tl_ladaco10_answers (uid bigint not null auto_increment, user_uid bigint, record_id integer, answer varchar(255), question_uid bigint, file_uuid bigint, file_version_id bigint, file_type varchar(255), file_name varchar(255), create_date datetime, primary key (uid)); create table tl_ladaco10_attachments (uid bigint not null auto_increment, file_version_id bigint, file_type varchar(255), file_name varchar(255), file_uuid bigint, create_date datetime, content_uid bigint, primary key (uid)); create table tl_ladaco10_contents (uid bigint not null auto_increment, create_date datetime, update_date datetime, create_by bigint, title varchar(255), 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, reflect_instructions varchar(255), reflect_on_activity bit, min_records smallint, max_records smallint, learner_entry_notify bit, record_submit_notify bit, primary key (uid)); create table tl_ladaco10_questions (uid bigint not null auto_increment, description varchar(255), create_by bigint, create_date datetime, is_required bit, question_type smallint, min_constraint float, max_constraint float, digits_decimal smallint, summary smallint, content_uid bigint, session_uid bigint, primary key (uid)); create table tl_ladaco10_sessions (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, content_uid bigint, session_id bigint, session_name varchar(250), primary key (uid)); create table tl_ladaco10_users (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, content_uid bigint, session_finished bit, primary key (uid)); alter table tl_ladaco10_answer_options add index FK5382D798E57F91D7 (question_uid), add constraint FK5382D798E57F91D7 foreign key (question_uid) references tl_ladaco10_questions (uid); alter table tl_ladaco10_answers add index AnswerToQuestion (question_uid), add constraint AnswerToQuestion foreign key (question_uid) references tl_ladaco10_questions (uid); alter table tl_ladaco10_answers add index AnswerToUser (user_uid), add constraint AnswerToUser foreign key (user_uid) references tl_ladaco10_users (uid); alter table tl_ladaco10_attachments add index FKDF470D1590B362E4 (content_uid), add constraint FKDF470D1590B362E4 foreign key (content_uid) references tl_ladaco10_contents (uid); alter table tl_ladaco10_contents add index DacoToUser (create_by), add constraint DacoToUser foreign key (create_by) references tl_ladaco10_users (uid); alter table tl_ladaco10_questions add index QuestionToDaco (content_uid), add constraint QuestionToDaco foreign key (content_uid) references tl_ladaco10_contents (uid); alter table tl_ladaco10_questions add index FKCB5397F25DF01D03 (session_uid), add constraint FKCB5397F25DF01D03 foreign key (session_uid) references tl_ladaco10_sessions (uid); alter table tl_ladaco10_questions add index QuestionToUser (create_by), add constraint QuestionToUser foreign key (create_by) references tl_ladaco10_users (uid); alter table tl_ladaco10_sessions add index SessionToDaco (content_uid), add constraint SessionToDaco foreign key (content_uid) references tl_ladaco10_contents (uid); alter table tl_ladaco10_users add index UserToDaco (content_uid), add constraint UserToDaco foreign key (content_uid) references tl_ladaco10_contents (uid); alter table tl_ladaco10_users add index UserToSession (session_uid), add constraint UserToSession foreign key (session_uid) references tl_ladaco10_sessions (uid);