 -- Estructura de tabla para la tabla `elections_surveys`
 --
 
-CREATE TABLE `elections_surveys` (
-  `survey` int(11) NOT NULL default '0',
-  `survey_option` int(11) NOT NULL default '0',
+CREATE TABLE IF NOT EXISTS `elections_surveys` (
+  `survey` int(11) NOT NULL DEFAULT '0',
+  `survey_option` int(11) NOT NULL DEFAULT '0',
   `election_user` int(11) NOT NULL,
-  `election_date` timestamp NOT NULL default CURRENT_TIMESTAMP,
-  PRIMARY KEY  (`survey`,`survey_option`,`election_user`),
-  KEY `election_user` (`election_user`)
+  `election_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
 ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
 
 -- --------------------------------------------------------

-- Estructura de tabla para la tabla `persons`
--

CREATE TABLE `persons` (
  `nif` varchar(9) collate utf8_unicode_ci NOT NULL,
  `name` varchar(40) collate utf8_unicode_ci NOT NULL,
  `surname1` varchar(40) collate utf8_unicode_ci NOT NULL,
  `surname2` varchar(40) collate utf8_unicode_ci NOT NULL,
  `birthdate` date NOT NULL,
  `city` int(11) NOT NULL,
  `province` int(11) NOT NULL,
  `security_key` varchar(255) collate utf8_unicode_ci NOT NULL,
  `creation_date` timestamp NOT NULL default CURRENT_TIMESTAMP,
  `email1` varchar(255) collate utf8_unicode_ci NOT NULL,
  `email2` varchar(255) collate utf8_unicode_ci default NULL,
  `phone` varchar(12) collate utf8_unicode_ci default NULL,
  `mobile` varchar(12) collate utf8_unicode_ci default NULL,
  `address` varchar(255) collate utf8_unicode_ci NOT NULL,
  PRIMARY KEY  (`nif`),
  KEY `city` (`city`),
  KEY `province` (`province`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

-- Estructura de tabla para la tabla `projects_talks`
--

CREATE TABLE IF NOT EXISTS `projects_talks` (
`id` int(11) NOT NULL,
  `title` varchar(75) COLLATE utf8_unicode_ci NOT NULL,
  `survey` int(11) DEFAULT NULL,
  `project` int(11) NOT NULL,
  `project_section` varchar(20) COLLATE utf8_unicode_ci NOT NULL,
  `creator` int(11) NOT NULL,
  `creation_date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `active` tinyint(1) NOT NULL DEFAULT '1'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;

-- --------------------------------------------------------

