alter table tl_laimag10_attachment drop foreign key FK6AB6721D2B86FA42; alter table tl_laimag10_imagegallery drop foreign key FK451FBF1B98EE9FF; alter table tl_laimag10_imagegallery_item drop foreign key FKF75F06A1B98EE9FF; alter table tl_laimag10_imagegallery_item drop foreign key FKF75F06A12B86FA42; alter table tl_laimag10_image_comment drop foreign key FKB20640417B33199; alter table tl_laimag10_image_comment drop foreign key FKB2064041B98EE9FF; alter table tl_laimag10_image_rating drop foreign key FK16529B7B7B33199; alter table tl_laimag10_image_rating drop foreign key FK16529B7BB98EE9FF; alter table tl_laimag10_image_vote drop foreign key FK89C11C487B33199; alter table tl_laimag10_image_vote drop foreign key FK89C11C48B98EE9FF; alter table tl_laimag10_item_log drop foreign key FK42F99B927B33199; alter table tl_laimag10_item_log drop foreign key FK42F99B9286078D61; alter table tl_laimag10_session drop foreign key FKD94E9BDC2B86FA42; alter table tl_laimag10_user drop foreign key FKFF92C845ACCD4BC3; alter table tl_laimag10_user drop foreign key FKFF92C8452B86FA42; drop table if exists tl_laimag10_attachment; drop table if exists tl_laimag10_configuration; drop table if exists tl_laimag10_imagegallery; drop table if exists tl_laimag10_imagegallery_item; drop table if exists tl_laimag10_image_comment; drop table if exists tl_laimag10_image_rating; drop table if exists tl_laimag10_image_vote; drop table if exists tl_laimag10_item_log; drop table if exists tl_laimag10_session; drop table if exists tl_laimag10_user; create table tl_laimag10_attachment (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, imageGallery_uid bigint, primary key (attachment_uid)); create table tl_laimag10_configuration (uid bigint not null auto_increment, config_key varchar(30) unique, config_value varchar(255), primary key (uid)); create table tl_laimag10_imagegallery (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, next_image_title bigint, online_instructions longtext, offline_instructions longtext, content_in_use bit, define_later bit, content_id bigint unique, allow_comment_images bit, allow_share_images bit, allow_vote bit, reflect_instructions varchar(255), reflect_on_activity bit, allow_rank bit, image_submit_notify bit, primary key (uid)); create table tl_laimag10_imagegallery_item (uid bigint not null auto_increment, title varchar(255), description longtext, sequence_id integer, create_by bigint, create_date datetime, create_by_author bit, is_hide bit, original_file_uuid bigint, original_image_width integer, original_image_height integer, medium_file_uuid bigint, medium_image_width integer, medium_image_height integer, thumbnail_file_uuid bigint, file_version_id bigint, file_type varchar(255), file_name varchar(255), imageGallery_uid bigint, primary key (uid)); create table tl_laimag10_image_comment (uid bigint not null auto_increment, create_date datetime, create_by bigint, comment longtext, imageGallery_item_uid bigint, primary key (uid)); create table tl_laimag10_image_rating (uid bigint not null auto_increment, create_by bigint, rating integer, imageGallery_item_uid bigint, primary key (uid)); create table tl_laimag10_image_vote (uid bigint not null auto_increment, create_by bigint, is_voted bit, imageGallery_item_uid bigint, primary key (uid)); create table tl_laimag10_item_log (uid bigint not null auto_increment, access_date datetime, imageGallery_item_uid bigint, user_uid bigint, complete bit, session_id bigint, primary key (uid)); create table tl_laimag10_session (uid bigint not null auto_increment, session_end_date datetime, session_start_date datetime, status integer, imageGallery_uid bigint, session_id bigint, session_name varchar(250), primary key (uid)); create table tl_laimag10_user (uid bigint not null auto_increment, user_id bigint, last_name varchar(255), first_name varchar(255), login_name varchar(255), session_uid bigint, imageGallery_uid bigint, session_finished bit, primary key (uid)); alter table tl_laimag10_attachment add index FK6AB6721D2B86FA42 (imageGallery_uid), add constraint FK6AB6721D2B86FA42 foreign key (imageGallery_uid) references tl_laimag10_imagegallery (uid); alter table tl_laimag10_imagegallery add index FK451FBF1B98EE9FF (create_by), add constraint FK451FBF1B98EE9FF foreign key (create_by) references tl_laimag10_user (uid); alter table tl_laimag10_imagegallery_item add index FKF75F06A1B98EE9FF (create_by), add constraint FKF75F06A1B98EE9FF foreign key (create_by) references tl_laimag10_user (uid); alter table tl_laimag10_imagegallery_item add index FKF75F06A12B86FA42 (imageGallery_uid), add constraint FKF75F06A12B86FA42 foreign key (imageGallery_uid) references tl_laimag10_imagegallery (uid); alter table tl_laimag10_image_comment add index FKB20640417B33199 (imageGallery_item_uid), add constraint FKB20640417B33199 foreign key (imageGallery_item_uid) references tl_laimag10_imagegallery_item (uid); alter table tl_laimag10_image_comment add index FKB2064041B98EE9FF (create_by), add constraint FKB2064041B98EE9FF foreign key (create_by) references tl_laimag10_user (uid); alter table tl_laimag10_image_rating add index FK16529B7B7B33199 (imageGallery_item_uid), add constraint FK16529B7B7B33199 foreign key (imageGallery_item_uid) references tl_laimag10_imagegallery_item (uid); alter table tl_laimag10_image_rating add index FK16529B7BB98EE9FF (create_by), add constraint FK16529B7BB98EE9FF foreign key (create_by) references tl_laimag10_user (uid); alter table tl_laimag10_image_vote add index FK89C11C487B33199 (imageGallery_item_uid), add constraint FK89C11C487B33199 foreign key (imageGallery_item_uid) references tl_laimag10_imagegallery_item (uid); alter table tl_laimag10_image_vote add index FK89C11C48B98EE9FF (create_by), add constraint FK89C11C48B98EE9FF foreign key (create_by) references tl_laimag10_user (uid); alter table tl_laimag10_item_log add index FK42F99B927B33199 (imageGallery_item_uid), add constraint FK42F99B927B33199 foreign key (imageGallery_item_uid) references tl_laimag10_imagegallery_item (uid); alter table tl_laimag10_item_log add index FK42F99B9286078D61 (user_uid), add constraint FK42F99B9286078D61 foreign key (user_uid) references tl_laimag10_user (uid); alter table tl_laimag10_session add index FKD94E9BDC2B86FA42 (imageGallery_uid), add constraint FKD94E9BDC2B86FA42 foreign key (imageGallery_uid) references tl_laimag10_imagegallery (uid); alter table tl_laimag10_user add index FKFF92C845ACCD4BC3 (session_uid), add constraint FKFF92C845ACCD4BC3 foreign key (session_uid) references tl_laimag10_session (uid); alter table tl_laimag10_user add index FKFF92C8452B86FA42 (imageGallery_uid), add constraint FKFF92C8452B86FA42 foreign key (imageGallery_uid) references tl_laimag10_imagegallery (uid);