Creation of database foundations.
This commit is contained in:
1 parent
a8046a1227
commit
cb07b71a88
4 files changed
+23
No files matched your search
@@ -0,0 +1 @@
|
||||
CREATE EXTENSION IF NOT EXISTS "uuid-ossp";
|
||||
+13
@@ -0,0 +1,13 @@
|
||||
CREATE TABLE IF NOT EXISTS "user" (
|
||||
id UUID NOT NULL,
|
||||
password VARCHAR NOT NULL,
|
||||
CONSTRAINT user_pk PRIMARY KEY (id)
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS user_role (
|
||||
user_id UUID NOT NULL,
|
||||
role SMALLINT,
|
||||
CONSTRAINT user_role_pk PRIMARY KEY (user_id, role),
|
||||
CONSTRAINT user_role_fk_user_id FOREIGN KEY (user_id) REFERENCES "user" (id)
|
||||
);
|
||||
CREATE INDEX user_role_fk_user_id_idx ON user_role (user_id);
|
||||
Reference in new issue
Block a user