Commits

dianmora  committed 5aada10

Update hsqldb installation scripts. ENCUESTAME-502

  • Participants
  • Parent commits ff3a6d1

Comments (0)

Files changed (3)

File encuestame-business/src/main/resources/org/encuestame/business/sqlscripts/hsqldb/install/alter.sql

 alter table userAccount_permission add constraint FKBE01CE4C43ADB63D foreign key (sec_id_permission) references permission
 alter table userAccount_permission add constraint FKBE01CE4C5F77A117 foreign key (sec_id_secondary) references userAccount
 alter table userAccount_project add constraint FKFBC45BBC84536452 foreign key (cat_id_project) references project
-alter table userAccount_project add constraint FKFBC45BBC5F77A117 foreign key (sec_id_secondary) references userAccount
+alter table userAccount_project add constraint FKFBC45BBC5F77A117 foreign key (sec_id_secondary) references userAccount
+alter table survey_temporal_result add constraint FK7867CF546BF7A1C foreign key (question_qid) references questions
+alter table survey_temporal_result add constraint FK7867CF5496009B4 foreign key (answer_q_answer_id) references questions_answers
+alter table survey_temporal_result add constraint FK7867CF551153812 foreign key (survey_sid) references surveys
+alter table question_preferences add constraint FKD540D01F46BF7A1C foreign key (question_qid) references questions

File encuestame-business/src/main/resources/org/encuestame/business/sqlscripts/hsqldb/install/drop.sql

 drop table userAccount if exists
 drop table userAccount_followers if exists
 drop table userAccount_permission if exists
-drop table userAccount_project if exists
+drop table userAccount_project if exists 
+drop table question_preferences if exists  
+drop table survey_temporal_result if exists

File encuestame-business/src/main/resources/org/encuestame/business/sqlscripts/hsqldb/install/tables.sql

 create table survey_group_format (sg_id bigint not null, id_sid_format bigint not null, primary key (id_sid_format, sg_id))
 create table survey_group_project (id_sid_format bigint not null, cat_id_project bigint not null, primary key (cat_id_project, id_sid_format))
 create table survey_pagination (pagination_id bigint generated by default as identity (start with 1), pageNumber integer, sid bigint not null, ssid bigint not null, primary key (pagination_id), unique (pagination_id))
-create table survey_result (rid bigint generated by default as identity (start with 1), answer_q_answer_id bigint, question_qid bigint, survey_sid bigint, primary key (rid), unique (rid))
-create table survey_section (ssid bigint generated by default as identity (start with 1), desc_section varchar(255), survey_sid bigint, primary key (ssid), unique (ssid))
-create table surveys (sid bigint generated by default as identity (start with 1), lat float, lng float, additional_info varchar(255), closeAfterDate bit, close_after_quota bit, close_date timestamp, closed_quota integer, created_at timestamp, custom_final_message integer, custom_message bit, custom_start_message varchar(255), dislike_vote bigint, end_date timestamp, favorites bit, hits bigint, ip_protection varchar(255), ip_restrictions bit, like_vote bigint, multiple_response integer, name varchar(255), notifications bit, number_votes bigint, optional_title varchar(255), password_protection varchar(255), password_restrictions bit, relevance bigint, showAdditionalInfo bit, comment_option integer, show_results bit, update_date timestamp, complete varchar(2), date_interview date, schedule_date_survey timestamp, is_Schedule bit, show_progress_bar bit, start_date timestamp, survey_slug_name varchar(255), ticket integer, editor bigint, owner_id bigint, project_project_id bigint, survey_folder bigint, primary key (sid), unique (sid))
+create table survey_result (rid bigint generated by default as identity (start with 1), txtResponse varchar(255), answer_q_answer_id bigint, question_qid bigint, survey_sid bigint, primary key (rid), unique (rid))
+create table survey_section (ssid bigint generated by default as identity (start with 1), desc_section varchar(255), section_name varchar(255), survey_sid bigint, primary key (ssid), unique (ssid))create table surveys (sid bigint generated by default as identity (start with 1), lat float, lng float, additional_info varchar(255), closeAfterDate bit, close_after_quota bit, close_date timestamp, closed_quota integer, created_at timestamp, custom_final_message integer, custom_message bit, custom_start_message varchar(255), dislike_vote bigint, end_date timestamp, favorites bit, hits bigint, ip_protection varchar(255), ip_restrictions bit, like_vote bigint, multiple_response integer, name varchar(255), notifications bit, number_votes bigint, optional_title varchar(255), password_protection varchar(255), password_restrictions bit, relevance bigint, showAdditionalInfo bit, comment_option integer, show_results bit, update_date timestamp, complete varchar(2), date_interview date, schedule_date_survey timestamp, is_Schedule bit, show_progress_bar bit, start_date timestamp, survey_slug_name varchar(255), ticket integer, editor bigint, owner_id bigint, project_project_id bigint, survey_folder bigint, primary key (sid), unique (sid))
 create table tweetPoll (tweet_poll_id bigint generated by default as identity (start with 1), lat float, lng float, allow_live_results bit, allow_repeated_votes bit, captcha bit, close_notification bit, completed bit not null, create_date timestamp, limit_with_date bit, date_limited timestamp, dislikeVote bigint, favourite bit, hits bigint, likeVote bigint, limit_votes integer, limits_votes_enabled bit, max_repeated_votes integer, numberVotes bigint, publish bit, relevance bigint, result_notification bit, resume_live_results bit, resume_tweetpoll_dashboard bit, schedule_date_tweet timestamp, schedule bit, last_date_updated timestamp, editor bigint, qid bigint not null, uid bigint not null, tweetPollFolderId bigint, primary key (tweet_poll_id), unique (tweet_poll_id))
 create table tweetPoll_Folder (tweetPollFolderId bigint generated by default as identity (start with 1), created_at date, folderName varchar(255) not null, folder_status integer, createdBy_uid bigint, uid bigint not null, primary key (tweetPollFolderId), unique (tweetPollFolderId))
 create table tweetPoll_save_published_status (status_save_poll_id bigint generated by default as identity (start with 1), type varchar(255), status_description varchar(255), publication_date_tweet timestamp, status integer, tweet_content varchar(255), tweet_id varchar(255), poll_poll_id bigint, socialAccount_social_account_id bigint, survey_sid bigint, tweetPoll_tweet_poll_id bigint, primary key (status_save_poll_id), unique (status_save_poll_id))
 create table userAccount_followers (uid bigint not null, uid_follower bigint not null, primary key (uid, uid_follower))
 create table userAccount_permission (sec_id_secondary bigint not null, sec_id_permission bigint not null, primary key (sec_id_permission, sec_id_secondary))
 create table userAccount_project (sec_id_secondary bigint not null, cat_id_project bigint not null, primary key (cat_id_project, sec_id_secondary))
+create table survey_temporal_result (IdTempResult bigint generated by default as identity (start with 1), txtResponse varchar(255), hash varchar(255) not null, answer_q_answer_id bigint, question_qid bigint, survey_sid bigint, primary key (IdTempResult), unique (hash), unique (IdTempResult))
+create table question_preferences (preferenceId bigint generated by default as identity (start with 1), preference varchar(255), value varchar(255), question_qid bigint, primary key (preferenceId), unique (preferenceId))