
CREATE TABLE tapps_emaillocks (
   poll_id int(11) NOT NULL,
   email varchar(255) NOT NULL,
   timestamp timestamp(14),
   PRIMARY KEY (poll_id, email)
);

CREATE TABLE tapps_iplocks (
   poll_id int(11) NOT NULL,
   ip varchar(32) NOT NULL,
   timestamp timestamp(14),
   PRIMARY KEY (poll_id, ip)
);


CREATE TABLE tapps_pending (
   id varchar(32) NOT NULL,
   poll_id int(11) NOT NULL,
   options varchar(255) NOT NULL,
   timestamp timestamp(14),
   PRIMARY KEY (id)
);


CREATE TABLE tapps_polls (
   poll_id int(10) unsigned NOT NULL auto_increment,
   title varchar(255) NOT NULL,
   valid_until datetime DEFAULT '0000-00-00 00:00:00' NOT NULL,
   max_answers tinyint(4) DEFAULT '1' NOT NULL,
   description varchar(255) NOT NULL,
   enabled enum('N','Y') DEFAULT 'N' NOT NULL,
   PRIMARY KEY (poll_id)
);


CREATE TABLE tapps_votes (
   poll_id int(11) NOT NULL,
   option_id tinyint(4) NOT NULL,
   option_text varchar(255) NOT NULL,
   counter int(11) NOT NULL,
   PRIMARY KEY (poll_id, option_id)
);


