+drop table if exists roles;
+drop table if exists users;
+drop table if exists user_role;
+
+create table users (
+ id INTEGER primary key autoincrement,
+ email TEXT unique not null,
+ password TEXT not null,
+ name TEXT unique,
+ organization TEXT,
+ is_admin INTEGER default 0 not null,
+ key TEXT
+);
+
+create table roles (
+ id INTEGER primary key autoincrement,
+ name TEXT,
+ 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)
+);
+