schema update

This commit is contained in:
Untone 2021-07-29 20:26:15 +03:00
parent 437be2229b
commit fb779217bc
3 changed files with 13 additions and 10 deletions

View File

@ -21,7 +21,7 @@ class PayLoad(BaseModel):
class CreateUser(BaseModel):
email: Text
username: Text
username: Optional[Text]
# age: Optional[int]
# phone: Optional[Text]
password: Optional[Text]

View File

@ -1,6 +1,6 @@
from typing import List
from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy import Column, Integer, String, relationship
from orm import Permission
from orm.base import Base
@ -13,8 +13,8 @@ class User(Base):
username: str = Column(String, nullable=False, comment="Name")
password: str = Column(String, nullable=True, comment="Password")
role_id: int = Column(ForeignKey("role.id"), nullable=True, comment="Role")
# role_id: list = Column(ForeignKey("role.id"), nullable=True, comment="Roles")
# roles = relationship("Role") TODO: one to many, see schema.graphql
oauth_id: str = Column(String, nullable=True)
@classmethod

View File

@ -4,7 +4,7 @@ scalar DateTime
input registerUserInput {
email: String!
username: String!
username: String
password: String!
}
@ -113,7 +113,10 @@ type Subscription {
############################################ Entities
type Role {
id: Int!
name: String!
org: String!
level: Int! # 1-8
desc: String
}
@ -139,7 +142,7 @@ type Message {
id: Int!
replyTo: Int
updatedAt: DateTime!
visibleForUsers: [Int]
visibleForUsers: [Int]!
}
# is publication
@ -160,17 +163,17 @@ type Shout {
topics: [String] # topic-slugs
title: String
versionOf: Int
visibleForRoles: [String]! # role ids are strings
visibleForRoles: [String] # role ids are strings
visibleForUsers: [Int]
}
type Topic {
slug: String! # ID
createdBy: Int! # User
original: String
createdAt: DateTime!
value: String
parents: [String] # NOTE: topic can have parent topics
children: [String] # and children
createdAt: DateTime!
}
# TODO: resolvers to add/remove topics from publication
@ -196,7 +199,7 @@ type Token {
type Like {
author: Int!
id: Int!
value: Int!
shout: Int
user: Int
value: Int!
}