2016-03-19 20:37:04 +00:00
|
|
|
import sqlalchemy as sa
|
2016-04-03 20:03:58 +00:00
|
|
|
from szurubooru.db.base import Base
|
2016-03-19 20:37:04 +00:00
|
|
|
|
|
|
|
class User(Base):
|
|
|
|
__tablename__ = 'user'
|
|
|
|
|
2016-03-28 12:14:50 +00:00
|
|
|
AVATAR_GRAVATAR = 1
|
|
|
|
AVATAR_MANUAL = 2
|
|
|
|
|
2016-03-19 20:37:04 +00:00
|
|
|
user_id = sa.Column('id', sa.Integer, primary_key=True)
|
2016-03-28 08:24:53 +00:00
|
|
|
name = sa.Column('name', sa.String(50), nullable=False, unique=True)
|
2016-03-19 20:37:04 +00:00
|
|
|
password_hash = sa.Column('password_hash', sa.String(64), nullable=False)
|
2016-04-09 17:54:25 +00:00
|
|
|
password_salt = sa.Column('password_salt', sa.String(32))
|
2016-03-19 20:37:04 +00:00
|
|
|
email = sa.Column('email', sa.String(200), nullable=True)
|
2016-04-09 17:54:25 +00:00
|
|
|
rank = sa.Column('rank', sa.String(32), nullable=False)
|
2016-03-19 20:37:04 +00:00
|
|
|
creation_time = sa.Column('creation_time', sa.DateTime, nullable=False)
|
2016-03-28 12:14:50 +00:00
|
|
|
last_login_time = sa.Column('last_login_time', sa.DateTime)
|
2016-04-09 17:54:25 +00:00
|
|
|
avatar_style = sa.Column('avatar_style', sa.String(32), nullable=False)
|