221d918aa9f0_add_user_authentication_infos.py 1.1 KB

123456789101112131415161718192021222324252627282930313233
  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. from alembic import op
  8. import sqlalchemy as sa
  9. revision = '221d918aa9f0'
  10. down_revision = '127be3fb000'
  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. with op.batch_alter_table('users', schema=None) as batch_op:
  22. batch_op.drop_column('activated')
  23. batch_op.drop_column('login_attempts')
  24. batch_op.drop_column('last_failed_login')
  25. ### end Alembic commands ###