X-Git-Url: http://git.cyclocoop.org/?a=blobdiff_plain;f=schema.sql;h=11001d64d362a4fff731856a0dfeb01ff3000526;hb=965e005bba1208ef170275c170bd7f7cc1cadbfa;hp=b24a7f369193126fac6230426b28c90253d3f123;hpb=251888ac340c188dcf60da3120a752450663d63e;p=cavote.git diff --git a/schema.sql b/schema.sql index b24a7f3..11001d6 100644 --- a/schema.sql +++ b/schema.sql @@ -3,6 +3,7 @@ drop table if exists attachments; drop table if exists votes; drop table if exists roles; drop table if exists users; +drop table if exists user_role; create table users ( id INTEGER primary key autoincrement, @@ -20,6 +21,14 @@ create table roles ( system INTEGER default 0 not null ); +create table user_role ( + id_user INTEGER, + id_role INTEGER, + FOREIGN KEY(id_user) REFERENCES users(id), + FOREIGN KEY(id_role) REFERENCES roles(id), + PRIMARY KEY(id_user, id_role) +); + create table votes ( id INTEGER primary key autoincrement, title TEXT not null, @@ -54,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");