Commits

dianmora  committed 01b21b2
  • Participants
  • Parent commits 8c46fcb

Comments (0)

Files changed (2)

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

 alter table groups add constraint FKB63DD9D45ECE45A2 foreign key (account_uid) references account
 alter table groups_permission add constraint FK7F1951A45895AFF foreign key (sec_id_group) references groups
 alter table groups_permission add constraint FK7F1951A43ADB63D foreign key (sec_id_permission) references permission
+alter table hits add constraint FK30DF40369F8B2C foreign key (userAccount_uid) references userAccount
 alter table hits add constraint FK30DF4019AA125 foreign key (hashTag_hash_tag_id) references hash_tags
 alter table hits add constraint FK30DF4063976E9 foreign key (poll_poll_id) references poll
 alter table hits add constraint FK30DF4051153812 foreign key (survey_sid) references surveys
 alter table poll_folder add constraint FKC5911CEE6EF241E9 foreign key (createdBy_uid) references userAccount
 alter table poll_hashtags add constraint FK9D199EA7DA98FFE1 foreign key (hastag_id) references hash_tags
 alter table poll_hashtags add constraint FK9D199EA7F0ED6769 foreign key (poll_id) references poll
-alter table poll_hashtags add constraint FK9D199EA761842F44 foreign key (poll_id) references surveys
 alter table poll_result add constraint FKD981C89DDDD118B5 foreign key (q_answer_id) references questions_answers
 alter table poll_result add constraint FKD981C89DF0ED6769 foreign key (poll_id) references poll
 alter table project add constraint FKED904B19514C1986 foreign key (lead_uid) references userAccount

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

 create table groups (group_id bigint generated by default as identity (start with 1), des_info varchar(255), name varchar(50), type varchar(255), id_state bigint, account_uid bigint, primary key (group_id), unique (group_id))
 create table groups_permission (sec_id_group bigint not null, sec_id_permission bigint not null, primary key (sec_id_group, sec_id_permission))
 create table hash_tags (hash_tag_id bigint generated by default as identity (start with 1), tag varchar(255), hits bigint, size bigint, hashtag_updated_date timestamp, primary key (hash_tag_id), unique (hash_tag_id))
-create table hits (hit_id bigint generated by default as identity (start with 1), created_at date, hits_ip_address varchar(100) not null, hashTag_hash_tag_id bigint, poll_poll_id bigint, survey_sid bigint, tweetPoll_tweet_poll_id bigint, primary key (hit_id), unique (hit_id))
+create table hits (hit_id bigint generated by default as identity (start with 1), hit_category integer not null, created_at date, hits_ip_address varchar(100) not null, hashTag_hash_tag_id bigint, poll_poll_id bigint, survey_sid bigint, tweetPoll_tweet_poll_id bigint, userAccount_uid bigint, primary key (hit_id), unique (hit_id))
 create table notification (notification_id bigint generated by default as identity (start with 1), additional_description varchar(255) not null, created timestamp not null, description varchar(255) not null, group_notification bit, readed bit not null, reference varchar(255), uid bigint not null, primary key (notification_id), unique (notification_id))
 create table permission (id_permission bigint generated by default as identity (start with 1), permission varchar(255), description varchar(255), primary key (id_permission), unique (id_permission))
 create table poll (poll_id 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, poll_completed bit not null, poll_hash varchar(255) not null, publish_poll bit, editor bigint, owner_id bigint, poll_folder bigint, qid bigint not null, primary key (poll_id), unique (poll_id), unique (poll_hash))
 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 tweetpoll_hashtags (tweetpoll_id bigint not null, hastag_id bigint not null, primary key (hastag_id, tweetpoll_id))
 create table tweetpoll_result (tweetpoll_resultId bigint generated by default as identity (start with 1), lat float, lng float, ip_vote varchar(100) not null, tweet_date_response timestamp not null, tweetpoll_switch_id bigint not null, primary key (tweetpoll_resultId), unique (tweetpoll_resultId))
-create table tweetpoll_switch (tweetpoll_switch_id bigint generated by default as identity (start with 1), tweet_code varchar(255) not null, last_date_updated timestamp not null, short_url varchar(255), q_answer_id bigint not null, tweet_poll_id bigint not null, primary key (tweetpoll_switch_id), unique (tweet_code), unique (tweetpoll_switch_id))
+create table tweetpoll_switch (tweetpoll_switch_id bigint generated by default as identity (start with 1), tweet_code varchar(255) not null, last_date_updated timestamp not null, relative_url varchar(400), short_url varchar(400), q_answer_id bigint not null, tweet_poll_id bigint not null, primary key (tweetpoll_switch_id), unique (tweet_code), unique (tweetpoll_switch_id))
 create table userAccount (uid bigint generated by default as identity (start with 1), lat float, lng float, name varchar(50), date_new timestamp, invite_code varchar(255), last_ip_logged varchar(255), last_time_logged timestamp, password varchar(255) not null, picture_source integer, shared_profile bit, email varchar(150) not null, userProfilePicture varchar(255), status bit, username varchar(30) not null, account_uid bigint, groupId bigint, primary key (uid), unique (username), unique (uid), unique (email), unique (username, email))
 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))