-
Notifications
You must be signed in to change notification settings - Fork 687
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added migration for revoked_tokens table
- Loading branch information
1 parent
0d6f1a2
commit efc006c
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
32 changes: 32 additions & 0 deletions
32
securedrop/alembic/versions/e9fa666b089a_added_revoked_tokens_table.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |