~sircmpwn/meta.sr.ht

ref: 72548bd7545f78670878667674cc7645835a17bd meta.sr.ht/metasrht/alembic/versions/cb4742f68f2c_swap_client_id_for_token_id_in_webhooks.py -rw-r--r-- 695 bytes
72548bd7Drew DeVault API: Updates per core-go auth changes 1 year, 3 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
"""Swap client_id for token_id in webhooks

Revision ID: cb4742f68f2c
Revises: 82ff5fc58b75
Create Date: 2019-02-12 20:38:36.940962

"""

# revision identifiers, used by Alembic.
revision = 'cb4742f68f2c'
down_revision = '82ff5fc58b75'

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.drop_column('user_webhook_subscription', 'client_id')
    op.add_column('user_webhook_subscription',
            sa.Column('token_id', sa.Integer, sa.ForeignKey("oauthtoken.id")))


def downgrade():
    op.drop_column('user_webhook_subscription', 'token_id')
    op.add_column('user_webhook_subscription',
            sa.Column('client_id', sa.Integer, sa.ForeignKey("oauthclient.id")))