b24a7f369193126fac6230426b28c90253d3f123
1 drop table if exists choices
;
2 drop table if exists attachments
;
3 drop table if exists votes
;
4 drop table if exists roles
;
5 drop table if exists users
;
8 id INTEGER primary key autoincrement
,
9 email
TEXT unique not null,
10 password TEXT not null,
13 is_admin
INTEGER default 0 not null,
18 id INTEGER primary key autoincrement
,
20 system INTEGER default 0 not null
24 id INTEGER primary key autoincrement
,
28 date_begin
INTEGER default CURRENT_TIMESTAMP not null,
29 date_end
INTEGER not null,
30 is_transparent
INTEGER default 1 not null,
31 is_public
INTEGER default 1 not null,
32 is_multiplechoice
INTEGER default 1 not null,
33 is_weighted
INTEGER default 0 not null,
34 is_open
INTEGER default 0 not null,
35 id_author
INTEGER, -- :COMMENT:maethor:120528: not null ?
36 id_role
INTEGER default 1 not null,
37 FOREIGN KEY(id_author
) REFERENCES users(id)
38 FOREIGN KEY(id_role
) REFERENCES roles(id)
41 create table attachments (
43 id_vote
INTEGER not null,
44 FOREIGN KEY(id_vote
) REFERENCES vote(id),
45 PRIMARY KEY(url
, id_vote
)
48 create table choices (
49 id INTEGER primary key autoincrement
,
51 id_vote
INTEGER not null,
52 FOREIGN KEY(id_vote
) REFERENCES vote(id)
57 insert into users (email
, password, name, organization
, is_admin
, key) values ("admin@admin.fr", "admin", "Toto (admin) Tata", "World corp", 1, "test");
58 insert into roles (id, name, system) values (1, "Tous", 1);
59 insert into roles (name) values ("CA");
60 insert into roles (name) values ("Members");