write a proper schema.sql
[ppolls.git] / schema.sql
blob3b4f1203648a842860c2d3869c3aa968550fd03d
1 create table if not exists entries (
2 id integer primary key autoincrement,
3 type string not null,
4 title string not null,
5 text string not null,
6 uid integer not null,
7 hits integer not null);
8 insert into entries values (1,'radio','first question','Is this the first question?',1,0);
9 insert into entries values (2,'checkbox','second question','Is this not the first question?',1,0);
11 create table if not exists answers (id integer primary key autoincrement,qid integer,content string not null,hits integer default 0);
12 insert into answers values (1,1,'yes',0);
13 insert into answers values (2,1,'no',0);
14 insert into answers values (3,1,'do not know',0);
15 insert into answers values (4,2,'yes!',0);
16 insert into answers values (5,2,'no!',0);
17 insert into answers values (6,2,'do not know...',0);
19     create table if not exists users (
20     id integer primary key autoincrement,
21     username string not null,
22     password string not null,
23     type integer not null,
24     hit string,
25     email string,
26     fullname string
27   );
28   
29   insert into users values (0,'a','c',0,"","e@ma.il","a full name");