1 drop table if exists choices
;
2 drop table if exists votes
;
3 drop table if exists roles
;
4 drop table if exists users
;
7 id INTEGER primary key autoincrement
,
8 email
TEXT unique not null,
9 password TEXT not null,
12 is_admin
INTEGER default 0 not null,
17 id INTEGER primary key autoincrement
,
19 system INTEGER default 0 not null
23 id INTEGER primary key autoincrement
,
27 date_begin
INTEGER default CURRENT_TIMESTAMP not null,
28 date_end
INTEGER not null,
29 is_transparent
INTEGER default 1 not null,
30 is_public
INTEGER default 1 not null,
31 is_multiplechoice
INTEGER default 1 not null,
32 is_weighted
INTEGER default 0 not null,
33 is_open
INTEGER default 0 not null,
34 id_author
INTEGER, -- :COMMENT:maethor:120528: not null ?
35 id_role
INTEGER default 1 not null,
36 FOREIGN KEY(id_author
) REFERENCES users(id)
37 FOREIGN KEY(id_role
) REFERENCES roles(id)
40 create table choices (
41 id INTEGER primary key autoincrement
,
43 id_vote
INTEGER not null,
44 FOREIGN KEY(id_vote
) REFERENCES vote(id)
49 insert into users (email
, password, name, organization
, is_admin
, key) values ("admin@admin.fr", "admin", "Toto (admin) Tata", "World corp", 1, "test");
50 insert into roles (id, name, system) values (1, "Tous", 1);
51 insert into roles (name) values ("CA");
52 insert into roles (name) values ("Members");