Skip to content

Commit

Permalink
added migration for revoked_tokens table
Browse files Browse the repository at this point in the history
  • Loading branch information
heartsucker committed Apr 17, 2019
1 parent 0d6f1a2 commit efc006c
Showing 1 changed file with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
"""added revoked_tokens table
Revision ID: e9fa666b089a
Revises: f2833ac34bb6
Create Date: 2019-04-16 12:06:56.610815
"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'e9fa666b089a'
down_revision = 'f2833ac34bb6'
branch_labels = None
depends_on = None


def upgrade():
op.create_table(
'revoked_tokens',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('journalist_id', sa.Integer(), nullable=True),
sa.Column('token', sa.Text(), nullable=False),
sa.ForeignKeyConstraint(['journalist_id'], ['journalists.id'], ),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('token')
)


def downgrade():
op.drop_table('revoked_tokens')

0 comments on commit efc006c

Please sign in to comment.