Commits

dianmora  committed 52f7a64

Update mysql installation scripts. ENCUESTAME-502

  • Participants
  • Parent commits 9f889b4

Comments (0)

Files changed (3)

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

 
 ALTER TABLE `hash_tags_ranking`
   ADD CONSTRAINT `FK71DECDA119AA125` FOREIGN KEY (`hashTag_hash_tag_id`) REFERENCES `hash_tags` (`hash_tag_id`);
+  
+--
+-- Constraints for table `question_preferences`
+--  
+ALTER TABLE `question_preferences`
+  ADD CONSTRAINT `FKD540D01F46BF7A1C` FOREIGN KEY (`question_qid`) REFERENCES `questions` (`qid`);
+  
+--
+-- Constraints for table `survey_temporal_result`
+--  
+ALTER TABLE `survey_temporal_result`
+  ADD CONSTRAINT `FK7867CF551153812` FOREIGN KEY (`survey_sid`) REFERENCES `surveys` (`sid`),
+  ADD CONSTRAINT `FK7867CF546BF7A1C` FOREIGN KEY (`question_qid`) REFERENCES `questions` (`qid`),
+  ADD CONSTRAINT `FK7867CF5496009B4` FOREIGN KEY (`answer_q_answer_id`) REFERENCES `questions_answers` (`q_answer_id`);

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

 -- Table structure for table 'userAccount_project'
 --
 
-DROP TABLE IF EXISTS userAccount_project;
+DROP TABLE IF EXISTS userAccount_project;
+
+--
+-- Table structure for table 'question_preferences'
+--
+DROP TABLE IF EXISTS question_preferences;
+
+--
+-- Table structure for table 'survey_temporal_result'
+--
+DROP TABLE IF EXISTS survey_temporal_result; 

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

   `answer_q_answer_id` bigint(20) DEFAULT NULL,
   `question_qid` bigint(20) DEFAULT NULL,
   `survey_sid` bigint(20) DEFAULT NULL,
+  `txtResponse` varchar(255) DEFAULT NULL,
+  `hash` varchar(255) NOT NULL,
   PRIMARY KEY (`rid`),
   UNIQUE KEY `rid` (`rid`),
   KEY `FK92EA04A246BF7A1C` (`question_qid`),
   `ssid` bigint(20) NOT NULL AUTO_INCREMENT,
   `desc_section` varchar(255) DEFAULT NULL,
   `survey_sid` bigint(20) DEFAULT NULL,
+  `section_name` varchar(255) DEFAULT NULL,
   PRIMARY KEY (`ssid`),
   UNIQUE KEY `ssid` (`ssid`),
   KEY `FKFE5AD30051153812` (`survey_sid`)
   PRIMARY KEY (`rank_id`),
   UNIQUE KEY `rank_id` (`rank_id`),
   KEY `FK71DECDA119AA125` (`hashTag_hash_tag_id`)
-) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2026 ;
+) ENGINE=InnoDB  DEFAULT CHARSET=utf8 AUTO_INCREMENT=2026;
+
+--
+-- Table structure for table `question_preferences`
+--
+
+CREATE TABLE IF NOT EXISTS `question_preferences` (
+  `preferenceId` bigint(20) NOT NULL AUTO_INCREMENT,
+  `preference` varchar(255) DEFAULT NULL,
+  `question_qid` bigint(20) DEFAULT NULL,
+  `value` varchar(255) DEFAULT NULL,
+  PRIMARY KEY (`preferenceId`),
+  UNIQUE KEY `preferenceId` (`preferenceId`),
+  KEY `FKD540D01F46BF7A1C` (`question_qid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1;
+
+
+--
+-- Table structure for table `survey_temporal_result`
+--
+CREATE TABLE IF NOT EXISTS `survey_temporal_result` (
+  `IdTempResult` bigint(20) NOT NULL AUTO_INCREMENT,
+  `txtResponse` varchar(255) DEFAULT NULL,
+  `hash` varchar(255) NOT NULL,
+  `answer_q_answer_id` bigint(20) DEFAULT NULL,
+  `question_qid` bigint(20) DEFAULT NULL,
+  `survey_sid` bigint(20) DEFAULT NULL,
+  PRIMARY KEY (`IdTempResult`),
+  UNIQUE KEY `IdTempResult` (`IdTempResult`),
+  UNIQUE KEY `hash` (`hash`),
+  KEY `FK7867CF546BF7A1C` (`question_qid`),
+  KEY `FK7867CF5496009B4` (`answer_q_answer_id`),
+  KEY `FK7867CF551153812` (`survey_sid`)
+) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;