gallery.accords-library.com/server/szurubooru/db/user.py

20 lines
793 B
Python
Raw Normal View History

2016-04-15 18:40:12 +00:00
from sqlalchemy import Column, Integer, String, DateTime
2016-04-03 20:03:58 +00:00
from szurubooru.db.base import Base
class User(Base):
__tablename__ = 'user'
2016-04-09 19:41:10 +00:00
AVATAR_GRAVATAR = 'gravatar'
AVATAR_MANUAL = 'manual'
2016-04-15 18:40:12 +00:00
user_id = Column('id', Integer, primary_key=True)
name = Column('name', String(50), nullable=False, unique=True)
password_hash = Column('password_hash', String(64), nullable=False)
password_salt = Column('password_salt', String(32))
email = Column('email', String(64), nullable=True)
2016-04-15 18:40:12 +00:00
rank = Column('rank', String(32), nullable=False)
creation_time = Column('creation_time', DateTime, nullable=False)
last_login_time = Column('last_login_time', DateTime)
avatar_style = Column(
'avatar_style', String(32), nullable=False, default=AVATAR_GRAVATAR)