diff options
Diffstat (limited to 'migrations/versions/df66c78e6791_.py')
-rw-r--r-- | migrations/versions/df66c78e6791_.py | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/migrations/versions/df66c78e6791_.py b/migrations/versions/df66c78e6791_.py new file mode 100644 index 0000000..b3f4088 --- /dev/null +++ b/migrations/versions/df66c78e6791_.py @@ -0,0 +1,26 @@ +"""empty message + +Revision ID: df66c78e6791 +Revises: a0f6c8743362 +Create Date: 2020-01-24 18:39:58.363417 + +""" +from alembic import op +import sqlalchemy as sa +from sqlalchemy.dialects import postgresql + +# revision identifiers, used by Alembic. +revision = 'df66c78e6791' +down_revision = 'a0f6c8743362' +branch_labels = None +depends_on = None + + +def upgrade(): + op.add_column('api_token', sa.Column('package_id', sa.Integer(), nullable=True)) + op.create_foreign_key(None, 'api_token', 'package', ['package_id'], ['id']) + + +def downgrade(): + op.drop_constraint(None, 'api_token', type_='foreignkey') + op.drop_column('api_token', 'package_id') |