X-Git-Url: https://git.cyclocoop.org/?a=blobdiff_plain;f=schema.sql;h=20ddccb955bc2d7cb17f63c1ded302e55eb14241;hb=ceddf4b06d5bc343c8de8016ead00ab99abdfeac;hp=c1805c4002b6bc76812ca81c979e2196c0d5d5c6;hpb=a2d3a797375c6e14889d89b975ee32e3068926b6;p=cavote.git diff --git a/schema.sql b/schema.sql index c1805c4..20ddccb 100644 --- a/schema.sql +++ b/schema.sql @@ -1,6 +1,7 @@ drop table if exists choices; drop table if exists attachments; drop table if exists votes; +drop table if exists user_role; drop table if exists roles; drop table if exists users; @@ -47,10 +48,10 @@ create table votes ( ); create table attachments ( + id INTEGER primary key autoincrement, url TEXT not null, id_vote INTEGER not null, - FOREIGN KEY(id_vote) REFERENCES vote(id), - PRIMARY KEY(url, id_vote) + FOREIGN KEY(id_vote) REFERENCES vote(id) ); create table choices ( @@ -62,7 +63,7 @@ create table choices ( -- Test data -insert into users (email, password, name, organization, is_admin, key) values ("admin@admin.fr", "admin", "Toto (admin) Tata", "World corp", 1, "test"); +insert into users (email, password, name, organization, is_admin, key) values ("admin@admin.fr", "d033e22ae348aeb5660fc2140aec35850c4da997", "Toto (admin) Tata", "World corp", 1, "test"); -- mdp = admin insert into roles (id, name, system) values (1, "Tous", 1); insert into roles (name) values ("CA"); insert into roles (name) values ("Members");