221d918aa9f0_add_user_authentication_infos.py 1.0 KB

1234567891011121314151617181920212223242526272829303132
  1. """Add user authentication infos
  2. Revision ID: 221d918aa9f0
  3. Revises: 127be3fb000
  4. Create Date: 2016-06-06 13:45:52.915050
  5. """
  6. # revision identifiers, used by Alembic.
  7. revision = '221d918aa9f0'
  8. down_revision = '127be3fb000'
  9. from alembic import op
  10. import sqlalchemy as sa
  11. def upgrade():
  12. # has no effect on other DBMS
  13. # read here for more info: http://alembic.zzzcomputing.com/en/latest/ops.html#alembic.operations.Operations.batch_alter_table
  14. with op.batch_alter_table('users', schema=None) as batch_op:
  15. batch_op.add_column(sa.Column('activated', sa.Boolean(), nullable=True))
  16. batch_op.add_column(sa.Column('last_failed_login', sa.DateTime(), nullable=True))
  17. batch_op.add_column(sa.Column('login_attempts', sa.Integer(), nullable=True))
  18. ### end Alembic commands ###
  19. def downgrade():
  20. ### commands auto generated by Alembic - please adjust! ###
  21. op.drop_column('users', 'activated')
  22. op.drop_column('users', 'login_attempts')
  23. op.drop_column('users', 'last_failed_login')
  24. ### end Alembic commands ###