CREATE TABLE "permissions" ( "id" int PRIMARY KEY, "name" varchar(255) ); CREATE TABLE "users_roles" ( "users_id" int CONSTRAINT users_id REFERENCES users(id), "roles_id" int CONSTRAINT roles_id REFERENCES roles(id), "" varchar(255) ); CREATE TABLE "roles" ( "id" int PRIMARY KEY, "name" varchar(255) ); CREATE TABLE "roles_permissions" ( "roles_id" int CONSTRAINT roles_id REFERENCES roles(id), "permissions_id" int CONSTRAINT permissions_id REFERENCES permissions(id) ); CREATE TABLE "users" ( "id" int PRIMARY KEY, "name" varchar(255) );