alter table tl_lavote11_nomination_content drop foreign key FKA8ECB2976B23BABB; alter table tl_lavote11_session drop foreign key FK2B42357D6B23BABB; alter table tl_lavote11_uploadedfile drop foreign key FKBBAF69556B23BABB; alter table tl_lavote11_usr drop foreign key FK581703FBFC06299B; alter table tl_lavote11_usr_attempt drop foreign key FKE1CD52896AF7D14B; alter table tl_lavote11_usr_attempt drop foreign key FKE1CD5289200CA953; drop table if exists tl_lavote11_content; drop table if exists tl_lavote11_nomination_content; drop table if exists tl_lavote11_session; drop table if exists tl_lavote11_uploadedfile; drop table if exists tl_lavote11_usr; drop table if exists tl_lavote11_usr_attempt; create table tl_lavote11_content (uid bigint not null auto_increment, content_id bigint not null, title longtext, instructions longtext, reflectionSubject longtext, creation_date datetime, update_date datetime, reflect bit, allowText bit, created_by bigint, run_offline bit, define_later bit, offline_instructions longtext, online_instructions longtext, content_in_use bit, lock_on_finish bit, maxNominationCount varchar(5), minNominationCount varchar(5), show_results bit, assigned_data_flow_object bit, max_external_inputs smallint, external_inputs_added smallint, submission_deadline datetime, primary key (uid)); create table tl_lavote11_nomination_content (uid bigint not null auto_increment, nomination longtext, display_order integer, vote_content_id bigint not null, primary key (uid)); create table tl_lavote11_session (uid bigint not null auto_increment, vote_session_id bigint not null, session_start_date datetime, session_end_date datetime, session_status varchar(100), session_name varchar(100), vote_content_id bigint, primary key (uid)); create table tl_lavote11_uploadedfile (submissionId bigint not null auto_increment, uuid varchar(255), isOnline_File bit, filename varchar(255), vote_content_id bigint, primary key (submissionId)); create table tl_lavote11_usr (uid bigint not null auto_increment, user_id bigint not null, username varchar(100), fullname varchar(100), responseFinalised bit, finalScreenRequested bit, vote_session_id bigint, primary key (uid)); create table tl_lavote11_usr_attempt (uid bigint not null auto_increment, attempt_time datetime, time_zone varchar(255), vote_nomination_content_id bigint not null, que_usr_id bigint not null, userEntry varchar(255), singleUserEntry bit, visible bit, primary key (uid)); alter table tl_lavote11_nomination_content add index FKA8ECB2976B23BABB (vote_content_id), add constraint FKA8ECB2976B23BABB foreign key (vote_content_id) references tl_lavote11_content (uid); alter table tl_lavote11_session add index FK2B42357D6B23BABB (vote_content_id), add constraint FK2B42357D6B23BABB foreign key (vote_content_id) references tl_lavote11_content (uid); alter table tl_lavote11_uploadedfile add index FKBBAF69556B23BABB (vote_content_id), add constraint FKBBAF69556B23BABB foreign key (vote_content_id) references tl_lavote11_content (uid); alter table tl_lavote11_usr add index FK581703FBFC06299B (vote_session_id), add constraint FK581703FBFC06299B foreign key (vote_session_id) references tl_lavote11_session (uid); alter table tl_lavote11_usr_attempt add index FKE1CD52896AF7D14B (que_usr_id), add constraint FKE1CD52896AF7D14B foreign key (que_usr_id) references tl_lavote11_usr (uid); alter table tl_lavote11_usr_attempt add index FKE1CD5289200CA953 (vote_nomination_content_id), add constraint FKE1CD5289200CA953 foreign key (vote_nomination_content_id) references tl_lavote11_nomination_content (uid);