class Rights(DB.Model): """Access rights""" name = DB.Column(DB.String(50), primary_key=True) group = DB.Column(DB.String(50), nullable=False) permission = DB.Column(DB.String(50), nullable=False) description = DB.Column(DB.String(255), nullable=False)
class Rights(DB.Model): """Access rights""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) name = DB.Column(DB.String(50), nullable=False, unique=True) group = DB.Column(DB.String(50), nullable=False) permission = DB.Column(DB.String(50), nullable=False) description = DB.Column(DB.String(255), nullable=False)
class User(DB.Model): """User data model""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) email = DB.Column(DB.String(255), nullable=False, unique=True) password = DB.Column(DB.String(255), nullable=False, server_default='') confirmed_at = DB.Column(DB.DateTime()) gdpr_version = DB.Column(DB.Integer, nullable=False) is_active = DB.Column(DB.Boolean(), nullable=False, server_default='0')
class Player(DB.Model): """User data model""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) user_uid = DB.Column(UUID, DB.ForeignKey('user.uid'), nullable=False) steam_id = DB.Column(DB.Integer, nullable=False) name = DB.Column(DB.String(50), nullable=False, unique=True) avatar = DB.Column(DB.String(300), nullable=False, unique=True) avatar_medium = DB.Column(DB.String(300), nullable=False, unique=True) avatar_full = DB.Column(DB.String(300), nullable=False, unique=True) user = DB.relationship('User', back_populates='players', lazy='select')
class User(DB.Model): """User data model""" __tablename__ = 'users' id = DB.Column(DB.Integer, primary_key=True) # pylint: disable=invalid-name steam_id = DB.Column(DB.String(50), nullable=False, unique=True) created_at = DB.Column(DB.DateTime())
class Token(DB.Model): """Token data model""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) token_type = DB.Column(DB.Integer, nullable=False) created_at = DB.Column(DB.DateTime(), nullable=False) valid_until = DB.Column(DB.DateTime(), nullable=False) is_active = DB.Column(DB.Boolean(), nullable=False, server_default='1') user_uid = DB.Column(UUID, DB.ForeignKey('user.uid'), nullable=False) note = DB.Column(DB.String(20), nullable=False, server_default='') user = DB.relationship('User', back_populates='tokens', lazy='select')
class RoleRights(DB.Model): """Connection roles <--> rights""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) role = DB.Column(DB.String(50), nullable=False) rights = DB.Column(DB.String(50), nullable=False)
class Role(DB.Model): """User Roles""" name = DB.Column(DB.String(50), primary_key=True)
class User(DB.Model): user_id = DB.Column(DB.String(40), primary_key=True) first_name = DB.Column(DB.String(100)) last_name = DB.Column(DB.String(100))
class UserRole(DB.Model): """User Roles""" uid = DB.Column(UUID, primary_key=True, default=uuid.uuid4) name = DB.Column(DB.String(50), nullable=False, unique=True)