1 drop table if exists choices
;
2 drop table if exists votes
;
3 drop table if exists users
;
6 id INTEGER primary key autoincrement
,
7 email
TEXT unique not null,
8 password TEXT not null,
11 is_admin
INTEGER default 0 not null,
16 id INTEGER primary key autoincrement
,
20 date_begin
INTEGER default CURRENT_TIMESTAMP not null,
21 date_end
INTEGER not null,
22 is_transparent
INTEGER default 1 not null,
23 is_public
INTEGER default 1 not null,
24 is_multiplechoice
INTEGER default 1 not null,
25 is_weighted
INTEGER default 0 not null,
26 is_open
INTEGER default 0 not null,
27 id_author
INTEGER, -- :COMMENT:maethor:120528: not null ?
29 FOREIGN KEY(id_author
) REFERENCES users(id)
30 --FOREIGN KEY(id_role) REFERENCES role(id)
33 create table choices (
34 id INTEGER primary key autoincrement
,
36 id_vote
INTEGER not null,
37 FOREIGN KEY(id_vote
) REFERENCES vote(id)
42 insert into users (email
, password, name, organization
, is_admin
, key) values ("admin@admin.fr", "admin", "Toto (admin) Tata", "World corp", 1, "test");