2
0
mirror of https://github.com/codl/forget synced 2024-12-12 00:19:52 +01:00
forget-cancellare-vecchi-toot/migrations/versions/d97fa46b5560_add_csrf_tokens.py
codl ccf1ca9c56
add csrf tokens 🔒🔒🔒🔒
2017-08-25 10:50:11 +02:00

27 lines
564 B
Python

"""add csrf tokens
Revision ID: d97fa46b5560
Revises: f8a153bc809b
Create Date: 2017-08-25 10:10:18.148120
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'd97fa46b5560'
down_revision = 'f8a153bc809b'
branch_labels = None
depends_on = None
def upgrade():
op.add_column('sessions', sa.Column('csrf_token', sa.String(), nullable=True))
op.execute('DELETE FROM sessions')
op.alter_column('sessions', 'csrf_token', nullable=False)
def downgrade():
op.drop_column('sessions', 'csrf_token')