~sircmpwn/meta.sr.ht

ref: 72548bd7545f78670878667674cc7645835a17bd meta.sr.ht/metasrht/alembic/versions/a73e0b144fd3_add_delegated_oauth_models.py -rw-r--r-- 1.3 KiB
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
27
28
29
30
31
32
33
34
35
36
"""Add delegated oauth models

Revision ID: a73e0b144fd3
Revises: e5f8d19beac2
Create Date: 2017-04-09 22:36:59.095173

"""

# revision identifiers, used by Alembic.
revision = 'a73e0b144fd3'
down_revision = 'e5f8d19beac2'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('oauthscope')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oauthscope',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
    sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
    sa.Column('client_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('name', sa.VARCHAR(length=256), autoincrement=False, nullable=False),
    sa.Column('description', sa.VARCHAR(length=512), autoincrement=False, nullable=False),
    sa.Column('write', sa.BOOLEAN(), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['client_id'], ['oauthclient.id'], name='oauthscope_client_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='oauthscope_pkey')
    )
    # ### end Alembic commands ###