mirror of
https://github.com/Derpy-Leggies/OnlyLegs.git
synced 2025-06-29 03:26:16 +00:00
Add alt_id to database for cookie management
update version
This commit is contained in:
parent
4e50a66514
commit
af497b7da7
9 changed files with 36 additions and 30 deletions
|
@ -27,7 +27,9 @@ class Users (base, UserMixin): # pylint: disable=too-few-public-methods, C0103
|
|||
"""
|
||||
__tablename__ = 'users'
|
||||
|
||||
# Gallery used information
|
||||
id = Column(Integer, primary_key=True)
|
||||
alt_id = Column(String, unique=True, nullable=False)
|
||||
username = Column(String, unique=True, nullable=False)
|
||||
email = Column(String, unique=True, nullable=False)
|
||||
password = Column(String, nullable=False)
|
||||
|
@ -35,9 +37,11 @@ class Users (base, UserMixin): # pylint: disable=too-few-public-methods, C0103
|
|||
|
||||
posts = relationship('Posts', backref='users')
|
||||
groups = relationship('Groups', backref='users')
|
||||
session = relationship('Sessions', backref='users')
|
||||
log = relationship('Logs', backref='users')
|
||||
|
||||
def get_id(self):
|
||||
return str(self.alt_id)
|
||||
|
||||
|
||||
class Posts (base): # pylint: disable=too-few-public-methods, C0103
|
||||
"""
|
||||
|
@ -91,22 +95,6 @@ class GroupJunction (base): # pylint: disable=too-few-public-methods, C0103
|
|||
post_id = Column(Integer, ForeignKey('posts.id'))
|
||||
|
||||
|
||||
class Sessions (base): # pylint: disable=too-few-public-methods, C0103
|
||||
"""
|
||||
Session table
|
||||
Joins with user
|
||||
"""
|
||||
__tablename__ = 'sessions'
|
||||
|
||||
id = Column(Integer, primary_key=True)
|
||||
user_id = Column(Integer, ForeignKey('users.id'))
|
||||
session_uuid = Column(String, nullable=False)
|
||||
ip_address = Column(String, nullable=False)
|
||||
user_agent = Column(String, nullable=False)
|
||||
active = Column(Boolean, nullable=False)
|
||||
created_at = Column(DateTime, nullable=False)
|
||||
|
||||
|
||||
class Logs (base): # pylint: disable=too-few-public-methods, C0103
|
||||
"""
|
||||
Log table
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue