# $Id: create_tables.mysql,v 1.7.2.1 2001/06/15 11:44:35 jengo Exp $

CREATE TABLE phpgw_polls_data (
   poll_id      int NOT NULL,
   option_text  char(50) NOT NULL,
   option_count int DEFAULT '0' NOT NULL,
   vote_id      int NOT NULL auto_increment,
   primary key (vote_id)
);

CREATE TABLE phpgw_polls_desc (
   poll_id        int NOT NULL auto_increment,
   poll_title     char(100) NOT NULL,
   poll_timestamp int NOT NULL,
   PRIMARY KEY (poll_id)
);

CREATE TABLE phpgw_polls_user (
   poll_id        int NOT NULL,
   vote_id        int DEFAULT '0' NOT NULL,
   user_id        int NOT NULL,
   vote_timestamp int
);

create table phpgw_polls_settings (
   setting_name   varchar(255),
   setting_value  varchar(255)
);

insert into phpgw_polls_settings values ('allow_multiable_votes','False');
insert into phpgw_polls_settings values ('currentpoll','1');

insert into phpgw_polls_desc (poll_title,poll_timestamp) values ('What came first ?',UNIX_TIMESTAMP());
insert into phpgw_polls_data (poll_id,option_text,vote_id) values ('1','The chicken','1');
insert into phpgw_polls_data (poll_id,option_text,vote_id) values ('1','The egg','2');
