Password are encrypted
[cavote.git] / schema.sql
index b24a7f3..7a35e9e 100644 (file)
@@ -20,6 +20,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 +62,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");