back/users: change access rank to string
This commit is contained in:
parent
44c34e5785
commit
c9a243cae8
2 changed files with 23 additions and 1 deletions
|
@ -0,0 +1,22 @@
|
||||||
|
'''
|
||||||
|
Changes access rank column to string
|
||||||
|
|
||||||
|
Revision ID: 89ca368219b6
|
||||||
|
Created at: 2016-03-28 10:35:40.285485
|
||||||
|
'''
|
||||||
|
|
||||||
|
import sqlalchemy as sa
|
||||||
|
from alembic import op
|
||||||
|
|
||||||
|
revision = '89ca368219b6'
|
||||||
|
down_revision = 'd186d2e9c2c9'
|
||||||
|
branch_labels = None
|
||||||
|
depends_on = None
|
||||||
|
|
||||||
|
def upgrade():
|
||||||
|
op.drop_column('user', 'access_rank')
|
||||||
|
op.add_column('user', sa.Column('access_rank', sa.String(length=32), nullable=False))
|
||||||
|
|
||||||
|
def downgrade():
|
||||||
|
op.drop_column('user', 'access_rank')
|
||||||
|
op.add_column('user', sa.Column('access_rank', sa.INTEGER(), autoincrement=False, nullable=False))
|
|
@ -9,7 +9,7 @@ class User(Base):
|
||||||
password_hash = sa.Column('password_hash', sa.String(64), nullable=False)
|
password_hash = sa.Column('password_hash', sa.String(64), nullable=False)
|
||||||
password_salt = sa.Column('pasword_salt', sa.String(32))
|
password_salt = sa.Column('pasword_salt', sa.String(32))
|
||||||
email = sa.Column('email', sa.String(200), nullable=True)
|
email = sa.Column('email', sa.String(200), nullable=True)
|
||||||
access_rank = sa.Column('access_rank', sa.Integer, nullable=False)
|
access_rank = sa.Column('access_rank', sa.String(32), nullable=False)
|
||||||
creation_time = sa.Column('creation_time', sa.DateTime, nullable=False)
|
creation_time = sa.Column('creation_time', sa.DateTime, nullable=False)
|
||||||
last_login_time = sa.Column('last_login_time', sa.DateTime, nullable=False)
|
last_login_time = sa.Column('last_login_time', sa.DateTime, nullable=False)
|
||||||
avatar_style = sa.Column('avatar_style', sa.Integer, nullable=False)
|
avatar_style = sa.Column('avatar_style', sa.Integer, nullable=False)
|
||||||
|
|
Loading…
Reference in a new issue