614f77cecc48_add_last_active_at.py 860 B

1234567891011121314151617181920212223242526272829303132
  1. """add last active at
  2. Revision ID: 614f77cecc48
  3. Revises: a45f4dfde53b
  4. Create Date: 2023-06-15 13:33:00.357467
  5. """
  6. import sqlalchemy as sa
  7. from alembic import op
  8. # revision identifiers, used by Alembic.
  9. revision = '614f77cecc48'
  10. down_revision = 'a45f4dfde53b'
  11. branch_labels = None
  12. depends_on = None
  13. def upgrade():
  14. # ### commands auto generated by Alembic - please adjust! ###
  15. with op.batch_alter_table('accounts', schema=None) as batch_op:
  16. batch_op.add_column(sa.Column('last_active_at', sa.DateTime(), server_default=sa.text('CURRENT_TIMESTAMP(0)'), nullable=False))
  17. # ### end Alembic commands ###
  18. def downgrade():
  19. # ### commands auto generated by Alembic - please adjust! ###
  20. with op.batch_alter_table('accounts', schema=None) as batch_op:
  21. batch_op.drop_column('last_active_at')
  22. # ### end Alembic commands ###