Compare commits
3 commits
6d538ed154
...
83fee98059
| Author | SHA1 | Date | |
|---|---|---|---|
| 83fee98059 | |||
| bac889b627 | |||
| 4ffa7dc93e |
2 changed files with 32 additions and 26 deletions
|
|
@ -196,7 +196,7 @@ paths:
|
|||
# error:
|
||||
# type: string
|
||||
|
||||
# /users:
|
||||
/users:
|
||||
# get:
|
||||
# summary: Search user
|
||||
# parameters:
|
||||
|
|
@ -218,28 +218,28 @@ paths:
|
|||
# items:
|
||||
# $ref: '#/components/schemas/User'
|
||||
|
||||
# post:
|
||||
# summary: Add new user
|
||||
# requestBody:
|
||||
# required: true
|
||||
# content:
|
||||
# application/json:
|
||||
# schema:
|
||||
# $ref: '#/components/schemas/User'
|
||||
# responses:
|
||||
# '200':
|
||||
# description: Add result
|
||||
# content:
|
||||
# application/json:
|
||||
# schema:
|
||||
# type: object
|
||||
# properties:
|
||||
# success:
|
||||
# type: boolean
|
||||
# error:
|
||||
# type: string
|
||||
# user_json:
|
||||
# $ref: '#/components/schemas/User'
|
||||
post:
|
||||
summary: Add new user
|
||||
requestBody:
|
||||
required: true
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
$ref: '#/components/schemas/User'
|
||||
responses:
|
||||
'200':
|
||||
description: Add result
|
||||
content:
|
||||
application/json:
|
||||
schema:
|
||||
type: object
|
||||
properties:
|
||||
success:
|
||||
type: boolean
|
||||
error:
|
||||
type: string
|
||||
user_json:
|
||||
$ref: '#/components/schemas/User'
|
||||
|
||||
# /users/{user_id}/titles:
|
||||
# get:
|
||||
|
|
@ -580,7 +580,7 @@ components:
|
|||
required:
|
||||
- user_id
|
||||
- nickname
|
||||
- creation_date
|
||||
# - creation_date
|
||||
UserTitle:
|
||||
type: object
|
||||
additionalProperties: true
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@ CREATE TABLE users (
|
|||
id bigint GENERATED ALWAYS AS IDENTITY PRIMARY KEY,
|
||||
avatar_id bigint REFERENCES images (id),
|
||||
passhash text NOT NULL,
|
||||
mail text CHECK (mail ~ '[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+'),
|
||||
nickname text NOT NULL CHECK (nickname ~ '^[a-zA-Z0-9_-]+$'),
|
||||
mail text CHECK (mail ~ '^[a-zA-Z0-9._-]+@[a-zA-Z0-9._-]+\.[a-zA-Z0-9_-]+$'),
|
||||
nickname text UNIQUE NOT NULL CHECK (nickname ~ '^[a-zA-Z0-9_-]{3,}$'),
|
||||
disp_name text,
|
||||
user_desc text,
|
||||
creation_date timestamptz NOT NULL,
|
||||
|
|
@ -85,6 +85,12 @@ CREATE TABLE signals (
|
|||
pending boolean NOT NULL
|
||||
);
|
||||
|
||||
CREATE TABLE external_ids (
|
||||
user_id NOT NULL REFERENCES users (id),
|
||||
service_id text NOT NULL,
|
||||
external_ids text NOT NULL
|
||||
);
|
||||
|
||||
-- Functions
|
||||
CREATE OR REPLACE FUNCTION update_title_rating()
|
||||
RETURNS TRIGGER AS $$
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue