-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
276 changed files
with
176 additions
and
243 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,13 @@ | ||
-- Roles to claims junction table | ||
|
||
CREATE TABLE IF NOT EXISTS "roles_claims" ( | ||
"role_id" UUID NOT NULL, | ||
"claim_id" UUID NOT NULL, | ||
create table if not exists "auth".roles_claims ( | ||
claim_id uuid not null, | ||
role_id uuid not null, | ||
|
||
PRIMARY KEY ("role_id", "claim_id"), | ||
primary key (claim_id, role_id), | ||
|
||
CONSTRAINT "idx__roles_claims__role_id__roles_id" | ||
FOREIGN KEY ("role_id") | ||
REFERENCES "roles" ("id"), | ||
|
||
CONSTRAINT "idx__roles_claims__claim_id__claims_id" | ||
FOREIGN KEY ("claim_id") | ||
REFERENCES "claims" ("id") | ||
constraint "fk__roles_claims__claim_id__claims__id" | ||
foreign key (claim_id) | ||
references "auth".claims(id), | ||
constraint "fk__roles_claims__role_id__roles__id" | ||
foreign key (role_id) | ||
references "auth".roles(id) | ||
); |
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,8 @@ | ||
-- Claims | ||
|
||
CREATE TABLE IF NOT EXISTS "claims" ( | ||
"id" UUID NOT NULL, | ||
"value" VARCHAR(255) NOT NULL, | ||
"name" VARCHAR(255) NULL, | ||
"description" VARCHAR(255) NULL, | ||
|
||
PRIMARY KEY ("id") | ||
create table if not exists "auth".claims ( | ||
id uuid primary key, | ||
value varchar(100) not null, | ||
description varchar(255) null | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__claims__value" | ||
ON "claims" ("value"); | ||
create index if not exists "idx__claims__value" | ||
on "auth".claims (value); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,8 @@ | ||
-- Roles | ||
|
||
CREATE TABLE IF NOT EXISTS "roles" ( | ||
"id" UUID NOT NULL, | ||
"name" VARCHAR(255) NOT NULL, | ||
"description" VARCHAR(255) NULL, | ||
|
||
PRIMARY KEY ("id") | ||
create table if not exists "auth".roles ( | ||
id uuid primary key, | ||
name varchar(255) not null, | ||
description varchar(255) not null | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__roles__name" | ||
ON "roles" ("name"); | ||
create index if not exists "idx__roles__name" | ||
on "auth".roles(name); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
-- Users main data | ||
|
||
CREATE TABLE IF NOT EXISTS "users" ( | ||
"id" UUID NOT NULL, | ||
"name" VARCHAR(100) NOT NULL, | ||
"email" VARCHAR(50) NOT NULL, | ||
|
||
PRIMARY KEY ("id") | ||
create table if not exists "user".users ( | ||
id uuid primary key, | ||
name varchar(255) not null, | ||
email varchar(255) not null, | ||
login varchar(255) not null, | ||
about text null | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__users__email" | ||
ON "users" ("email"); | ||
create index if not exists "idx__users__login" | ||
on "user".users(login); | ||
|
||
create index if not exists "idx__users__email" | ||
on "user".users(email); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,10 @@ | ||
-- Users auth data | ||
|
||
CREATE TABLE IF NOT EXISTS "users_auth" ( | ||
"user_id" UUID NOT NULL, | ||
"login" VARCHAR(30) NOT NULL, | ||
"password" VARCHAR(255) NOT NULL, | ||
"password_salt" VARCHAR(255) NOT NULL, | ||
create table if not exists "auth".users_auth ( | ||
user_id uuid primary key, | ||
is_confirmed boolean not null, | ||
password varchar(255) not null, | ||
password_salt varchar(255) not null, | ||
|
||
PRIMARY KEY ("user_id"), | ||
|
||
CONSTRAINT "FK__users_auth__user_id__users__id" | ||
FOREIGN KEY ("user_id") | ||
REFERENCES "users" ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS idx__users_auth__login | ||
ON "users_auth" ("login"); | ||
constraint "fk__users_auth__user_id__users__id" | ||
foreign key (user_id) | ||
references "user".users(id) | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,15 @@ | ||
-- News | ||
|
||
CREATE TABLE IF NOT EXISTS "news" ( | ||
"id" UUID NOT NULL, | ||
"title" VARCHAR(255) NOT NULL, | ||
"body" TEXT NOT NULL, | ||
|
||
PRIMARY KEY ("id") | ||
create table if not exists "news".news ( | ||
id uuid primary key, | ||
author_id uuid not null, | ||
title varchar(255) not null, | ||
body text not null, | ||
creation_date timestamp not null, | ||
last_updated_date timestamp null, | ||
|
||
constraint "fk__news__author_id__users__id" | ||
foreign key (author_id) | ||
references "user".users (id) | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS idx__news__title | ||
ON "news" ("title"); | ||
create index if not exists "idx__news__title" | ||
on "news".news(title); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,10 @@ | ||
-- Documents linked to articles | ||
|
||
CREATE TABLE IF NOT EXISTS "articles_documents" ( | ||
"article_id" UUID NOT NULL, | ||
"document_path" VARCHAR(255) NOT NULL, | ||
create table if not exists "article".articles_documents ( | ||
id uuid primary key, | ||
article_id uuid not null, | ||
name varchar(255) not null, | ||
filepath varchar(255) not null, | ||
|
||
PRIMARY KEY ("article_id", "document_path"), | ||
|
||
CONSTRAINT "FK__articles_documents__article_id__articles__id" | ||
FOREIGN KEY ("article_id") | ||
REFERENCES "articles" ("id") | ||
); | ||
constraint "fk__articles_documents__article_id__articles__id" | ||
foreign key (article_id) | ||
references "article".articles(id) | ||
); |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
-- Roles to claims junction table | ||
|
||
CREATE TABLE IF NOT EXISTS "roles_claims" ( | ||
"role_id" UUID NOT NULL, | ||
"claim_id" UUID NOT NULL, | ||
|
||
PRIMARY KEY ("role_id", "claim_id"), | ||
|
||
CONSTRAINT "idx__roles_claims__role_id__roles_id" | ||
FOREIGN KEY ("role_id") | ||
REFERENCES "roles" ("id"), | ||
|
||
CONSTRAINT "idx__roles_claims__claim_id__claims_id" | ||
FOREIGN KEY ("claim_id") | ||
REFERENCES "claims" ("id") | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
-- Claims | ||
|
||
CREATE TABLE IF NOT EXISTS "claims" ( | ||
"id" UUID NOT NULL, | ||
"value" VARCHAR(255) NOT NULL, | ||
"name" VARCHAR(255) NULL, | ||
"description" VARCHAR(255) NULL, | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__claims__value" | ||
ON "claims" ("value"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Roles | ||
|
||
CREATE TABLE IF NOT EXISTS "roles" ( | ||
"id" UUID NOT NULL, | ||
"name" VARCHAR(255) NOT NULL, | ||
"description" VARCHAR(255) NULL, | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__roles__name" | ||
ON "roles" ("name"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Users main data | ||
|
||
CREATE TABLE IF NOT EXISTS "users" ( | ||
"id" UUID NOT NULL, | ||
"name" VARCHAR(100) NOT NULL, | ||
"email" VARCHAR(50) NOT NULL, | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS "idx__users__email" | ||
ON "users" ("email"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
-- Users auth data | ||
|
||
CREATE TABLE IF NOT EXISTS "users_auth" ( | ||
"user_id" UUID NOT NULL, | ||
"login" VARCHAR(30) NOT NULL, | ||
"password" VARCHAR(255) NOT NULL, | ||
"password_salt" VARCHAR(255) NOT NULL, | ||
|
||
PRIMARY KEY ("user_id"), | ||
|
||
CONSTRAINT "FK__users_auth__user_id__users__id" | ||
FOREIGN KEY ("user_id") | ||
REFERENCES "users" ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS idx__users_auth__login | ||
ON "users_auth" ("login"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- News | ||
|
||
CREATE TABLE IF NOT EXISTS "news" ( | ||
"id" UUID NOT NULL, | ||
"title" VARCHAR(255) NOT NULL, | ||
"body" TEXT NOT NULL, | ||
|
||
PRIMARY KEY ("id") | ||
); | ||
|
||
CREATE INDEX IF NOT EXISTS idx__news__title | ||
ON "news" ("title"); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
-- Documents linked to articles | ||
|
||
CREATE TABLE IF NOT EXISTS "articles_documents" ( | ||
"article_id" UUID NOT NULL, | ||
"document_path" VARCHAR(255) NOT NULL, | ||
|
||
PRIMARY KEY ("article_id", "document_path"), | ||
|
||
CONSTRAINT "FK__articles_documents__article_id__articles__id" | ||
FOREIGN KEY ("article_id") | ||
REFERENCES "articles" ("id") | ||
); |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Oops, something went wrong.