CREATE TABLE IF NOT EXISTS `polls` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `agora_id` smallint NOT NULL,
  `title` varchar(64) NOT NULL,
  `maxVotes` smallint NOT NULL,
  `open` datetime,
  `close` datetime,
  `published` BOOLEAN NOT NULL DEFAULT '0',

  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

CREATE TABLE IF NOT EXISTS `pollOptions` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `pollOption` varchar(128),
  `poll_id` int(11),
  `votes` int(11),
  `description` varchar(256),
  
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

CREATE TABLE IF NOT EXISTS `pollBallots` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `ticket` int(11),
  `poll_id` int(11) NOT NULL,
  `pollOption_id` int(11),
  `body` char(3),
  `delegate` varchar(100),
  
  PRIMARY KEY (`id`)
) ENGINE=MyISAM  DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;

ALTER TABLE `notifications` CHANGE `type` `type` ENUM( 'Proposal', 'Rollcall', 'Election', 'Poll' ) DEFAULT NULL 

