Compare commits

..

No commits in common. "83fee98059ced5aaee9a1109ccb5129cf47fc360" and "6d538ed15419d898482f94da4de7da1067974817" have entirely different histories.

2 changed files with 26 additions and 32 deletions

View file

@ -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

View file

@ -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 UNIQUE NOT NULL CHECK (nickname ~ '^[a-zA-Z0-9_-]{3,}$'),
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_-]+$'),
disp_name text,
user_desc text,
creation_date timestamptz NOT NULL,
@ -85,12 +85,6 @@ 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 $$