Python sqlalchemy.ForeignKeyConstraint() Examples

The following are code examples for showing how to use sqlalchemy.ForeignKeyConstraint(). They are from open source Python projects. You can vote up the examples you like or vote down the ones you don't like.

Example 1
Project: flasky   Author: RoseOu   File: 51f5ccfba190_comments.py    MIT License 7 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('comments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('body_html', sa.Text(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('disabled', sa.Boolean(), nullable=True),
    sa.Column('author_id', sa.Integer(), nullable=True),
    sa.Column('post_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_comments_timestamp', 'comments', ['timestamp'], unique=False)
    ### end Alembic commands ### 
Example 2
Project: comport   Author: codeforamerica   File: 33fcc9c4867_.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('citizen_complaint',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('opaque_id', sa.String(length=255), nullable=False),
    sa.Column('occured_date', sa.DateTime(), nullable=True),
    sa.Column('division', sa.String(length=255), nullable=True),
    sa.Column('precinct', sa.String(length=255), nullable=True),
    sa.Column('shift', sa.String(length=255), nullable=True),
    sa.Column('beat', sa.String(length=255), nullable=True),
    sa.Column('disposition', sa.String(length=255), nullable=True),
    sa.Column('census_tract', sa.String(length=255), nullable=True),
    sa.Column('resident_race', sa.String(length=255), nullable=True),
    sa.Column('officer_race', sa.String(length=255), nullable=True),
    sa.Column('resident_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_sex', sa.String(length=255), nullable=True),
    sa.Column('officer_identifier', sa.String(length=255), nullable=True),
    sa.Column('officer_years_of_service', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('opaque_id')
    )
    ### end Alembic commands ### 
Example 3
Project: comport   Author: codeforamerica   File: 720df9948a25_.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def upgrade():
    op.create_table(
        'assaults_on_officers',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('department_id', sa.Integer(), nullable=False),
        sa.Column('opaque_id', sa.String(length=255), nullable=False),
        sa.Column('officer_identifier', sa.String(length=255), nullable=True),
        sa.Column('service_type', sa.String(length=255), nullable=True),
        sa.Column('force_type', sa.String(length=255), nullable=True),
        sa.Column('assignment', sa.String(length=255), nullable=True),
        sa.Column('arrest_made', sa.Boolean(), nullable=True),
        sa.Column('officer_injured', sa.Boolean(), nullable=True),
        sa.Column('officer_killed', sa.Boolean(), nullable=True),
        sa.Column('report_filed', sa.Boolean(), nullable=True),
        sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 4
Project: comport   Author: codeforamerica   File: 52979aa7977_.py    BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=80), nullable=False),
    sa.Column('email', sa.String(length=80), nullable=False),
    sa.Column('password', sa.String(length=128), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('first_name', sa.String(length=30), nullable=True),
    sa.Column('last_name', sa.String(length=30), nullable=True),
    sa.Column('active', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email'),
    sa.UniqueConstraint('username')
    )
    op.create_table('roles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 5
Project: call-forwarding-flask   Author: TwilioDevEd   File: 06a8443ce88f_.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('states',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('zipcodes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('zipcode', sa.String(), nullable=False),
    sa.Column('state', sa.String(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('senators',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('state_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(), nullable=False),
    sa.Column('phone', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['state_id'], ['states.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 6
Project: zun   Author: openstack   File: cf46a28f46bc_add_container_actions_table.py    Apache License 2.0 6 votes vote down vote up
def upgrade():
    op.create_table(
        'container_actions',
        sa.Column('created_at', sa.DateTime(), nullable=True),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('action', sa.String(length=255), nullable=True),
        sa.Column('container_uuid', sa.String(length=36), nullable=False),
        sa.Column('request_id', sa.String(length=255), nullable=True),
        sa.Column('user_id', sa.String(length=255), nullable=True),
        sa.Column('project_id', sa.String(length=255), nullable=True),
        sa.Column('start_time', sa.DateTime(), nullable=True),
        sa.Column('finish_time', sa.DateTime(), nullable=True),
        sa.Column('message', sa.String(length=255), nullable=True),
        sa.Index('container_uuid_idx', 'container_uuid'),
        sa.Index('request_id_idx', 'request_id'),
        sa.ForeignKeyConstraint(['container_uuid'], ['container.uuid'], ),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 7
Project: zun   Author: openstack   File: 26896d5f9053_create_exec_instance_table.py    Apache License 2.0 6 votes vote down vote up
def upgrade():
    op.create_table(
        'exec_instance',
        sa.Column('created_at', sa.DateTime(), nullable=True),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('id', sa.Integer(), primary_key=True, nullable=False),
        sa.Column('container_id', sa.Integer(), nullable=False),
        sa.Column('exec_id', sa.String(255), nullable=False),
        sa.Column('token', sa.String(255), nullable=True),
        sa.Column('url', sa.String(255), nullable=True),
        sa.PrimaryKeyConstraint('id'),
        sa.ForeignKeyConstraint(['container_id'], ['container.id'],
                                ondelete='CASCADE'),
        sa.UniqueConstraint('container_id', 'exec_id',
                            name='uniq_exec_instance0container_id_exec_id'),
    ) 
Example 8
Project: zun   Author: openstack   File: b6bfca998431_add_container_actions_events_table.py    Apache License 2.0 6 votes vote down vote up
def upgrade():
    op.create_table(
        'container_actions_events',
        sa.Column('created_at', sa.DateTime(), nullable=True),
        sa.Column('updated_at', sa.DateTime(), nullable=True),
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('event', sa.String(length=255), nullable=True),
        sa.Column('action_id', sa.Integer(), nullable=False),
        sa.Column('start_time', sa.DateTime(), nullable=True),
        sa.Column('finish_time', sa.DateTime(), nullable=True),
        sa.Column('result', sa.String(length=255), nullable=True),
        sa.Column('traceback', sa.Text(), nullable=True),
        sa.Column('details', sa.Text(), nullable=True),
        sa.ForeignKeyConstraint(['action_id'], ['container_actions.id'], ),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 9
Project: gitlab-tools   Author: Salamek   File: 56189bfb2c5f_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('fingerprint',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('hostname', sa.String(length=255), nullable=True),
    sa.Column('sha256_fingerprint', sa.String(length=255), nullable=True),
    sa.Column('hashed_hostname', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('user_id', 'hashed_hostname', name='_user_id_hashed_hostname_uc')
    )
    op.create_index(op.f('ix_fingerprint_hashed_hostname'), 'fingerprint', ['hashed_hostname'], unique=False)
    op.create_index(op.f('ix_fingerprint_user_id'), 'fingerprint', ['user_id'], unique=False)
    # ### end Alembic commands ### 
Example 10
Project: gitlab-tools   Author: Salamek   File: 20bcb4b2673c_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('task_result',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('pull_mirror_id', sa.Integer(), nullable=True),
    sa.Column('push_mirror_id', sa.Integer(), nullable=True),
    sa.Column('task_id', sa.String(length=155), nullable=True),
    sa.Column('status', sa.String(length=50), nullable=True),
    sa.Column('task_name', sa.String(length=255), nullable=True),
    sa.Column('invoked_by', sa.Integer(), nullable=True),
    sa.Column('result', sa.PickleType(), nullable=True),
    sa.Column('date_done', sa.DateTime(), nullable=True),
    sa.Column('traceback', sa.Text(), nullable=True),
    sa.ForeignKeyConstraint(['pull_mirror_id'], ['pull_mirror.id'], ),
    sa.ForeignKeyConstraint(['push_mirror_id'], ['push_mirror.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('task_id')
    )
    op.create_index(op.f('ix_task_result_pull_mirror_id'), 'task_result', ['pull_mirror_id'], unique=False)
    op.create_index(op.f('ix_task_result_push_mirror_id'), 'task_result', ['push_mirror_id'], unique=False)
    # ### end Alembic commands ### 
Example 11
Project: snet-marketplace-service   Author: singnet   File: 15908b8d7b1d_baseline.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('order',
    sa.Column('id', sa.VARCHAR(length=255), nullable=False),
    sa.Column('amount', mysql.JSON(), nullable=False),
    sa.Column('username', sa.VARCHAR(length=225), nullable=False),
    sa.Column('created_at', sa.TIMESTAMP(), nullable=True),
    sa.Column('item_details', mysql.JSON(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('payment',
    sa.Column('payment_id', sa.VARCHAR(length=255), nullable=False),
    sa.Column('amount', mysql.JSON(), nullable=False),
    sa.Column('order_id', sa.VARCHAR(length=255), nullable=False),
    sa.Column('payment_details', mysql.JSON(), nullable=False),
    sa.Column('payment_status', sa.VARCHAR(length=225), nullable=False),
    sa.Column('created_at', sa.TIMESTAMP(), nullable=True),
    sa.ForeignKeyConstraint(['order_id'], ['order.id'], onupdate='CASCADE', ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('payment_id')
    )
    # ### end Alembic commands ### 
Example 12
Project: maubot   Author: maubot   File: d295f8dcfa64_initial_revision.py    GNU Affero General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('client',
    sa.Column('id', sa.String(length=255), nullable=False),
    sa.Column('homeserver', sa.String(length=255), nullable=False),
    sa.Column('access_token', sa.Text(), nullable=False),
    sa.Column('enabled', sa.Boolean(), nullable=False),
    sa.Column('next_batch', sa.String(length=255), nullable=False),
    sa.Column('filter_id', sa.String(length=255), nullable=False),
    sa.Column('sync', sa.Boolean(), nullable=False),
    sa.Column('autojoin', sa.Boolean(), nullable=False),
    sa.Column('displayname', sa.String(length=255), nullable=False),
    sa.Column('avatar_url', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('plugin',
    sa.Column('id', sa.String(length=255), nullable=False),
    sa.Column('type', sa.String(length=255), nullable=False),
    sa.Column('enabled', sa.Boolean(), nullable=False),
    sa.Column('primary_user', sa.String(length=255), nullable=False),
    sa.Column('config', sa.Text(), nullable=False),
    sa.ForeignKeyConstraint(['primary_user'], ['client.id'], onupdate='CASCADE', ondelete='RESTRICT'),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 13
Project: SUMSarizer   Author: SUMSarizer   File: 46ae5e506646_.py    MIT License 6 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=True),
    sa.Column('description', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('roles_users',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], )
    )
    op.add_column(u'users', sa.Column('active', sa.Boolean(), nullable=True))
    op.add_column(u'users', sa.Column('confirmed_at', sa.DateTime(), nullable=True))
    op.add_column(u'users', sa.Column('password', sa.String(length=255), nullable=True))
    ### end Alembic commands ### 
Example 14
Project: SUMSarizer   Author: SUMSarizer   File: 56c689702a23_.py    MIT License 6 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('resultdatapoints',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('value', sa.Float(), nullable=True),
    sa.Column('prediction', sa.Float(), nullable=True),
    sa.Column('job_id', sa.Integer(), nullable=True),
    sa.Column('datapoint_id', sa.Integer(), nullable=True),
    sa.Column('dataset_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['datapoint_id'], ['datapoints.id'], ),
    sa.ForeignKeyConstraint(['dataset_id'], ['datasets.id'], ),
    sa.ForeignKeyConstraint(['job_id'], ['sz_job.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_resultdatapoints_datapoint_id'), 'resultdatapoints', ['datapoint_id'], unique=False)
    op.create_index(op.f('ix_resultdatapoints_dataset_id'), 'resultdatapoints', ['dataset_id'], unique=False)
    op.create_index(op.f('ix_resultdatapoints_timestamp'), 'resultdatapoints', ['timestamp'], unique=False)
    ### end Alembic commands ### 
Example 15
Project: networking-sfc   Author: openstack   File: fa75d46a7f11_add_port_pair_group_params.py    Apache License 2.0 6 votes vote down vote up
def upgrade():
    op.create_table('sfc_port_pair_group_params',
                    sa.Column('keyword', sa.String(length=255),
                              nullable=False),
                    sa.Column('value', sa.String(length=255),
                              nullable=True),
                    sa.Column('pair_group_id', sa.String(length=36),
                              nullable=False),
                    sa.ForeignKeyConstraint(['pair_group_id'],
                                            ['sfc_port_pair_groups.id'],
                                            ondelete='CASCADE'),
                    sa.PrimaryKeyConstraint('keyword', 'pair_group_id'),
                    mysql_engine='InnoDB'
                    )
    op.add_column('sfc_port_chains', sa.Column('chain_id',
                  sa.Integer(), nullable=False))
    op.create_unique_constraint(None, 'sfc_port_chains', ['chain_id'])
    op.add_column('sfc_port_pair_groups', sa.Column('group_id',
                  sa.Integer(), nullable=False))
    op.create_unique_constraint(None, 'sfc_port_pair_groups', ['group_id']) 
Example 16
Project: Akeso   Author: ameserole   File: c7225db614c1_adding_hints_and_unlocks_tables.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('hints',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.Integer(), nullable=True),
    sa.Column('chal', sa.Integer(), nullable=True),
    sa.Column('hint', sa.Text(), nullable=True),
    sa.Column('cost', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['chal'], ['challenges.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('unlocks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('teamid', sa.Integer(), nullable=True),
    sa.Column('date', sa.DateTime(), nullable=True),
    sa.Column('itemid', sa.Integer(), nullable=True),
    sa.Column('model', sa.String(length=32), nullable=True),
    sa.ForeignKeyConstraint(['teamid'], ['teams.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 17
Project: hydra_login2f   Author: epandurski   File: e0bf58591d51_.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=False),
    sa.Column('salt', sa.String(length=32), nullable=False),
    sa.Column('password_hash', sa.String(length=128), nullable=False),
    sa.Column('recovery_code_hash', sa.String(length=128), nullable=True),
    sa.Column('two_factor_login', sa.Boolean(), nullable=False),
    sa.PrimaryKeyConstraint('user_id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('user_update_signal',
    sa.Column('user_update_signal_id', sa.BigInteger(), autoincrement=True, nullable=False),
    sa.Column('user_id', sa.BigInteger(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.user_id'], ),
    sa.PrimaryKeyConstraint('user_update_signal_id')
    )
    # ### end Alembic commands ### 
Example 18
Project: authserver   Author: brighthive   File: cee6c8486115_.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('username', sa.String(length=40), nullable=False),
    sa.Column('firstname', sa.String(length=40), nullable=False),
    sa.Column('lastname', sa.String(length=40), nullable=False),
    sa.Column('organization', sa.String(length=120), nullable=False),
    sa.Column('email_address', sa.String(length=40), nullable=False),
    sa.Column('telephone', sa.String(length=20), nullable=True),
    sa.Column('data_trust_id', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['data_trust_id'], ['data_trusts.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('username'),
    sa.UniqueConstraint('username')
    )
    # ### end Alembic commands ### 
Example 19
Project: authserver   Author: brighthive   File: 22122e1bd0e1_.py    MIT License 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oauth2_roles',
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('role', sa.String(), nullable=False),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('rules', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('role'),
    sa.UniqueConstraint('role')
    )
    op.create_table('roles',
    sa.Column('client_id', sa.String(), nullable=False),
    sa.Column('role_id', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['client_id'], ['oauth2_clients.id'], ),
    sa.ForeignKeyConstraint(['role_id'], ['oauth2_roles.id'], ),
    sa.PrimaryKeyConstraint('client_id', 'role_id')
    )
    # ### end Alembic commands ### 
Example 20
Project: intercom-rank   Author: uploadcare   File: 080002be4a97_.py    MIT License 6 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('projects',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.Column('title', sa.Unicode(length=255), nullable=False),
    sa.Column('intercom_app_id', sa.Unicode(length=255), nullable=False),
    sa.Column('intercom_api_key', sa.Unicode(length=255), nullable=False),
    sa.Column('aws_access_id', sa.Unicode(length=255), nullable=False),
    sa.Column('aws_secret_access_key', sa.Unicode(length=255), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('aws_access_id'),
    sa.UniqueConstraint('intercom_app_id')
    )
    ### end Alembic commands ### 
Example 21
Project: SempoBlockchain   Author: teamsempo   File: dadfc046c4cb_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('referral',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('first_name', sa.String(), nullable=True),
    sa.Column('last_name', sa.String(), nullable=True),
    sa.Column('reason', sa.String(), nullable=True),
    sa.Column('_phone', sa.String(), nullable=True),
    sa.Column('referring_user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['referring_user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 22
Project: SempoBlockchain   Author: teamsempo   File: 902a827bc3e4_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('pin_to_public_id',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('PIN', sa.Integer(), nullable=True),
    sa.Column('public_id', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('feedback',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('rating', sa.Float(), nullable=True),
    sa.Column('additional_information', sa.String(), nullable=True),
    sa.Column('transfer_account_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['transfer_account_id'], ['transfer_account.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 23
Project: SempoBlockchain   Author: teamsempo   File: c9db3658816a_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('spend_approval',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('eth_send_task_id', sa.Integer(), nullable=True),
    sa.Column('approval_task_id', sa.Integer(), nullable=True),
    sa.Column('receiving_address', sa.String(), nullable=True),
    sa.Column('token_id', sa.Integer(), nullable=True),
    sa.Column('giving_transfer_account_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['giving_transfer_account_id'], ['transfer_account.id'], ),
    sa.ForeignKeyConstraint(['token_id'], ['token.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_table('spend_approvals')
    op.add_column('organisation', sa.Column('system_blockchain_address', sa.String(), nullable=True))
    # ### end Alembic commands ### 
Example 24
Project: SempoBlockchain   Author: teamsempo   File: c9db3658816a_.py    GNU General Public License v3.0 6 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('organisation', 'system_blockchain_address')
    op.create_table('spend_approvals',
    sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
    sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('eth_send_task_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('approval_task_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('token_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('giving_transfer_account_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('receiving_transfer_account_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['giving_transfer_account_id'], ['transfer_account.id'], name='spend_approvals_giving_transfer_account_id_fkey'),
    sa.ForeignKeyConstraint(['receiving_transfer_account_id'], ['transfer_account.id'], name='spend_approvals_receiving_transfer_account_id_fkey'),
    sa.ForeignKeyConstraint(['token_id'], ['token.id'], name='spend_approvals_token_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='spend_approvals_pkey')
    )
    op.drop_table('spend_approval')
    # ### end Alembic commands ### 
Example 25
Project: SempoBlockchain   Author: teamsempo   File: cd5cb44c8f7c_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('fiat_ramp',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('_payment_method', sa.String(), nullable=True),
    sa.Column('payment_amount', sa.Integer(), nullable=True),
    sa.Column('payment_reference', sa.String(), nullable=True),
    sa.Column('payment_status', sa.Enum('PENDING', 'FAILED', 'COMPLETE', name='fiatrampstatusenum'), nullable=True),
    sa.Column('credit_transfer_id', sa.Integer(), nullable=True),
    sa.Column('token_id', sa.Integer(), nullable=True),
    sa.Column('payment_metadata', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
    sa.ForeignKeyConstraint(['credit_transfer_id'], ['credit_transfer.id'], ),
    sa.ForeignKeyConstraint(['token_id'], ['token.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 26
Project: SempoBlockchain   Author: teamsempo   File: 2ccfaa8b79e7_.py    GNU General Public License v3.0 6 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('spend_approvals',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('eth_send_task_id', sa.Integer(), nullable=True),
    sa.Column('approval_task_id', sa.Integer(), nullable=True),
    sa.Column('token_id', sa.Integer(), nullable=True),
    sa.Column('giving_transfer_account_id', sa.Integer(), nullable=True),
    sa.Column('receiving_transfer_account_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['giving_transfer_account_id'], ['transfer_account.id'], ),
    sa.ForeignKeyConstraint(['receiving_transfer_account_id'], ['transfer_account.id'], ),
    sa.ForeignKeyConstraint(['token_id'], ['token.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 27
Project: flasky   Author: RoseOu   File: 1b966e7f4b9e_post_model.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('posts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('author_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_posts_timestamp', 'posts', ['timestamp'], unique=False)
    ### end Alembic commands ### 
Example 28
Project: flasky   Author: RoseOu   File: 2356a38169ea_followers.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('follows',
    sa.Column('follower_id', sa.Integer(), nullable=False),
    sa.Column('followed_id', sa.Integer(), nullable=False),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['followed_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['follower_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('follower_id', 'followed_id')
    )
    ### end Alembic commands ### 
Example 29
Project: flasky   Author: RoseOu   File: 38c4e85512a9_initial_migration.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('roles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('ix_users_username', 'users', ['username'], unique=True)
    ### end Alembic commands ### 
Example 30
Project: comport   Author: codeforamerica   File: 0de6730e3d41_create_wpd_complaints_table.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.create_table(
        'citizen_complaints_wpd',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('department_id', sa.Integer(), sa.ForeignKey('departments.id'), nullable=False),
        sa.Column('opaque_id', sa.String(255), unique=False, nullable=True),
        sa.Column('received_date', sa.DateTime, unique=False, nullable=True),
        sa.Column('division', sa.String(255), unique=False, nullable=True),
        sa.Column('bureau', sa.String(255), unique=False, nullable=True),
        sa.Column('shift', sa.String(255), unique=False, nullable=True),
        sa.Column('service_type', sa.String(255), unique=False, nullable=True),
        sa.Column('source', sa.String(255), unique=False, nullable=True),
        sa.Column('incident_type', sa.String(255), unique=False, nullable=True),
        sa.Column('allegation', sa.String(255), unique=False, nullable=True),
        sa.Column('finding', sa.String(255), unique=False, nullable=True),
        sa.Column('disposition', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_id', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_race', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_sex', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_age', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_id', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_race', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_sex', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_age', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_years_of_service', sa.String(255), unique=False, nullable=True),
        sa.ForeignKeyConstraint(['department_id'], ['departments.id']),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 31
Project: comport   Author: codeforamerica   File: 4ffa73ef2b8_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('chart_block_defaults',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(length=255), nullable=False),
    sa.Column('caption', sa.String(length=255), nullable=True),
    sa.Column('slug', sa.String(length=255), nullable=False),
    sa.Column('dataset', sa.String(length=255), nullable=False),
    sa.Column('content', sa.Text(convert_unicode=True), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('chart_blocks',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(length=255), nullable=False),
    sa.Column('caption', sa.String(length=255), nullable=True),
    sa.Column('slug', sa.String(length=255), nullable=False),
    sa.Column('dataset', sa.String(length=255), nullable=False),
    sa.Column('content', sa.Text(), nullable=True),
    sa.Column('date_updated', sa.DateTime(), nullable=True),
    sa.Column('date_edited', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('use_of_force_incidents', sa.Column('received_date', sa.DateTime(), nullable=True))
    ### end Alembic commands ### 
Example 32
Project: comport   Author: codeforamerica   File: 32d7cc46df4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('demographic_values',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('race', sa.String(length=255), nullable=True),
    sa.Column('gender', sa.String(length=255), nullable=True),
    sa.Column('count', sa.Integer(), nullable=True),
    sa.Column('department_value', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 33
Project: comport   Author: codeforamerica   File: 3df24031e72_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('links',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('title', sa.String(length=255), nullable=False),
    sa.Column('url', sa.String(length=2083), nullable=False),
    sa.Column('type', sa.String(length=255), nullable=False),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 34
Project: comport   Author: codeforamerica   File: 875c52a485_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('use_of_force_incidents',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('opaque_id', sa.String(length=255), nullable=False),
    sa.Column('month', sa.Integer(), nullable=True),
    sa.Column('year', sa.Integer(), nullable=True),
    sa.Column('department_id', sa.Integer(), nullable=True),
    sa.Column('status', sa.String(length=255), nullable=True),
    sa.Column('disposition', sa.String(length=255), nullable=True),
    sa.Column('service_type', sa.String(length=255), nullable=True),
    sa.Column('day_of_week', sa.String(length=255), nullable=True),
    sa.Column('hour', sa.Integer(), nullable=True),
    sa.Column('arrest_made', sa.Boolean(), nullable=True),
    sa.Column('arrest_charges', sa.String(length=255), nullable=True),
    sa.Column('citizen_hospitalized', sa.Boolean(), nullable=True),
    sa.Column('citizen_injured', sa.Boolean(), nullable=True),
    sa.Column('officer_injured', sa.Boolean(), nullable=True),
    sa.Column('officer_hospitalized', sa.Boolean(), nullable=True),
    sa.Column('use_of_force_reason', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('opaque_id')
    )
    op.drop_table('serviceTypes')
    op.drop_table('months')
    ### end Alembic commands ### 
Example 35
Project: comport   Author: codeforamerica   File: 32f2dcfc96d_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('denominator_values',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('month', sa.Integer(), nullable=False),
    sa.Column('year', sa.Integer(), nullable=False),
    sa.Column('arrests', sa.Integer(), nullable=True),
    sa.Column('calls_for_service', sa.Integer(), nullable=True),
    sa.Column('officer_initiated_calls', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 36
Project: comport   Author: codeforamerica   File: c21533f2fd07_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    # create the incidents_updated table
    op.create_table(
        'incidents_updated',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('department_id', sa.Integer(), nullable=False),
        sa.Column('opaque_id', sa.String(length=255), nullable=False),
        sa.Column('incident_type', sa.String(length=32), nullable=False),
        sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
        sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_incidents_updated_opaque_id'), 'incidents_updated', ['opaque_id'], unique=False) 
Example 37
Project: comport   Author: codeforamerica   File: 17b38c3d5e7_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('serviceTypes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('month_id', sa.Integer(), nullable=True),
    sa.Column('service_type', sa.String(length=36), nullable=False),
    sa.Column('count', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['month_id'], ['months.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 38
Project: comport   Author: codeforamerica   File: 43bdec0aeb4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('invite_codes',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('department_id', sa.Integer(), nullable=True),
    sa.Column('code', sa.String(length=36), nullable=False),
    sa.Column('used', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('code')
    )
    op.create_index(op.f('ix_invite_codes_id'), 'invite_codes', ['id'], unique=False)
    ### end Alembic commands ### 
Example 39
Project: comport   Author: codeforamerica   File: 52eaf89477f_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user_department_relationship_table',
    sa.Column('department_id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('department_id', 'user_id')
    )
    ### end Alembic commands ### 
Example 40
Project: comport   Author: codeforamerica   File: 4f5fcadcf2d_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('links',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('department_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('title', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('url', sa.VARCHAR(length=2083), autoincrement=False, nullable=False),
    sa.Column('type', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], name='links_department_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='links_pkey')
    )
    ### end Alembic commands ### 
Example 41
Project: comport   Author: codeforamerica   File: 331c513e8d4_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('months',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('month', sa.Integer(), nullable=True),
    sa.Column('year', sa.Integer(), nullable=True),
    sa.Column('department_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ### 
Example 42
Project: comport   Author: codeforamerica   File: 331a821cc4a_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('use_of_force_incidents', 'resident_condition')
    op.drop_column('use_of_force_incidents', 'officer_condition')
    op.create_table('citizen_complaint',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('department_id', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('opaque_id', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
    sa.Column('occured_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
    sa.Column('division', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('precinct', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('shift', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('beat', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('disposition', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('census_tract', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('resident_race', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('officer_race', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('resident_sex', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('officer_sex', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('officer_identifier', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('officer_years_of_service', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('category', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('officer_age', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.Column('resident_age', sa.VARCHAR(length=255), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], name='citizen_complaint_department_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='citizen_complaint_pkey')
    )
    op.drop_table('citizen_complaints')
    op.drop_table('officer_involved_shootings')
    ### end Alembic commands ### 
Example 43
Project: comport   Author: codeforamerica   File: 1826863c726a_.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.create_table(
        'use_of_force_incidents_lmpd',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('department_id', sa.Integer(), nullable=False),
        sa.Column('opaque_id', sa.String(length=255), nullable=False),
        sa.Column('occured_date', sa.DateTime(), nullable=True),
        sa.Column('bureau', sa.String(length=255), nullable=True),
        sa.Column('division', sa.String(length=255), nullable=True),
        sa.Column('unit', sa.String(length=255), nullable=True),
        sa.Column('platoon', sa.String(length=255), nullable=True),
        sa.Column('disposition', sa.String(length=255), nullable=True),
        sa.Column('use_of_force_reason', sa.String(length=255), nullable=True),
        sa.Column('officer_force_type', sa.String(length=255), nullable=True),
        sa.Column('service_type', sa.String(length=255), nullable=True),
        sa.Column('arrest_made', sa.Boolean(), nullable=True),
        sa.Column('arrest_charges', sa.String(length=255), nullable=True),
        sa.Column('resident_injured', sa.Boolean(), nullable=True),
        sa.Column('resident_hospitalized', sa.Boolean(), nullable=True),
        sa.Column('resident_condition', sa.String(length=255), nullable=True),
        sa.Column('officer_injured', sa.Boolean(), nullable=True),
        sa.Column('officer_hospitalized', sa.Boolean(), nullable=True),
        sa.Column('officer_condition', sa.String(length=255), nullable=True),
        sa.Column('resident_identifier', sa.String(length=255), nullable=True),
        sa.Column('resident_weapon_used', sa.String(length=255), nullable=True),
        sa.Column('resident_race', sa.String(length=255), nullable=True),
        sa.Column('resident_sex', sa.String(length=255), nullable=True),
        sa.Column('resident_age', sa.String(length=255), nullable=True),
        sa.Column('officer_race', sa.String(length=255), nullable=True),
        sa.Column('officer_sex', sa.String(length=255), nullable=True),
        sa.Column('officer_age', sa.String(length=255), nullable=True),
        sa.Column('officer_years_of_service', sa.String(length=255), nullable=True),
        sa.Column('officer_identifier', sa.String(length=255), nullable=True),
        sa.ForeignKeyConstraint(['department_id'], ['departments.id'], ),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 44
Project: comport   Author: codeforamerica   File: 4d1cde26d807_create_wpd_uof_table.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.create_table(
        'use_of_force_incidents_wpd',
        sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('department_id', sa.Integer(), sa.ForeignKey('departments.id'), nullable=False),
        sa.Column('opaque_id', sa.String(255), unique=False, nullable=True),
        sa.Column('received_date', sa.DateTime, unique=False, nullable=True),
        sa.Column('division', sa.String(255), unique=False, nullable=True),
        sa.Column('bureau', sa.String(255), unique=False, nullable=True),
        sa.Column('shift', sa.String(255), unique=False, nullable=True),
        sa.Column('use_of_force_reason', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_resist_type', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_resistance', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_force_type', sa.String(255), unique=False, nullable=True),
        sa.Column('arrest_charges', sa.String(255), unique=False, nullable=True),
        sa.Column('disposition', sa.String(255), unique=False, nullable=True),
        sa.Column('service_type', sa.String(255), unique=False, nullable=True),
        sa.Column('arrest_made', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_id', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_injured', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_hospitalized', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_condition', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_race', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_sex', sa.String(255), unique=False, nullable=True),
        sa.Column('citizen_age', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_id', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_injured', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_hospitalized', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_race', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_sex', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_age', sa.String(255), unique=False, nullable=True),
        sa.Column('officer_years_of_service', sa.String(255), unique=False, nullable=True),
        sa.ForeignKeyConstraint(['department_id'], ['departments.id']),
        sa.PrimaryKeyConstraint('id')
    ) 
Example 45
Project: pornote   Author: haltode   File: 04ef75b50778_.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('member',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('first_name', sa.String(length=64), nullable=True),
    sa.Column('last_name', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(length=128), nullable=True),
    sa.Column('password', sa.String(length=64), nullable=True),
    sa.Column('points', sa.Integer(), nullable=True),
    sa.Column('class_nb', sa.Integer(), nullable=True),
    sa.Column('section', sa.String(length=64), nullable=True),
    sa.Column('second_lang', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('homework',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('member_id', sa.Integer(), nullable=False),
    sa.Column('subject', sa.String(length=128), nullable=True),
    sa.Column('section', sa.String(length=64), nullable=True),
    sa.Column('description', sa.String(length=256), nullable=True),
    sa.Column('end_date', sa.Date(), nullable=True),
    sa.Column('filename', sa.String(length=128), nullable=True),
    sa.Column('class_nb', sa.Integer(), nullable=True),
    sa.Column('is_public', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['member_id'], ['member.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('filename')
    )
    ### end Alembic commands ### 
Example 46
Project: mtanchor_demo   Author: forest-snow   File: 293c8607996c_.py    MIT License 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('start',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('anchors1', sa.String(), nullable=True),
    sa.Column('topics1', sa.String(), nullable=True),
    sa.Column('Q1', sa.String(), nullable=True),
    sa.Column('vocab1', sa.String(), nullable=True),
    sa.Column('index1', sa.String(), nullable=True),
    sa.Column('dict1', sa.String(), nullable=True),
    sa.Column('anchors2', sa.String(), nullable=True),
    sa.Column('topics2', sa.String(), nullable=True),
    sa.Column('Q2', sa.String(), nullable=True),
    sa.Column('vocab2', sa.String(), nullable=True),
    sa.Column('index2', sa.String(), nullable=True),
    sa.Column('dict2', sa.String(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('update',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('anchors1', sa.String(), nullable=True),
    sa.Column('anchors2', sa.String(), nullable=True),
    sa.Column('topics1', sa.String(), nullable=True),
    sa.Column('topics2', sa.String(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 47
Project: flask-s3-save-example   Author: Jaza   File: 83da20f4d7a_.py    Apache License 2.0 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('role',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=255), nullable=False),
    sa.Column('description', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('thingy',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('image', sa.String(length=255), nullable=False),
    sa.Column('image_storage_type', sa.String(length=255), nullable=False),
    sa.Column('image_storage_bucket_name', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=255), nullable=False),
    sa.Column('password', sa.String(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('roles_users',
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['role.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    ### end Alembic commands ### 
Example 48
Project: beavy   Author: beavyHQ   File: 15c488d628b_.py    Mozilla Public License 2.0 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('private_message_participants',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('pm_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['pm_id'], ['objects.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], )
    )
    op.add_column('objects', sa.Column('title', sa.String(length=255), nullable=False))
    ### end Alembic commands ### 
Example 49
Project: invenio-userprofiles   Author: inveniosoftware   File: c25ef2c50ffa_create_userprofiles_tables.py    MIT License 5 votes vote down vote up
def upgrade():
    """Upgrade database."""
    op.create_table(
        'userprofiles_userprofile',
        sa.Column('user_id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=255), nullable=True),
        sa.Column('displayname', sa.String(length=255), nullable=True),
        sa.Column('full_name', sa.String(length=255), nullable=False),
        sa.ForeignKeyConstraint(['user_id'], [u'accounts_user.id'], ),
        sa.PrimaryKeyConstraint('user_id'),
        sa.UniqueConstraint('username')
    ) 
Example 50
Project: SUMSarizer   Author: SUMSarizer   File: 2289e585ec7b_.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('sz_job',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('study_id', sa.Integer(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('state', sa.String(length=64), nullable=True),
    sa.ForeignKeyConstraint(['study_id'], ['studies.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_sz_job_study_id'), 'sz_job', ['study_id'], unique=False)
    ### end Alembic commands ### 
Example 51
Project: backend.ai-manager   Author: lablup   File: 7ea324d0535b_vfolder_and_kernel.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('kernels', sa.Column('agent_id', sa.VARCHAR(), autoincrement=False, nullable=True))
    op.drop_constraint(op.f('fk_kernels_agent_agents'), 'kernels', type_='foreignkey')
    op.drop_index(op.f('ix_kernels_terminated_at'), table_name='kernels')
    op.drop_index(op.f('ix_kernels_status'), table_name='kernels')
    op.drop_index(op.f('ix_kernels_created_at'), table_name='kernels')
    op.drop_column('kernels', 'status_info')
    op.drop_column('kernels', 'num_queries')
    op.drop_column('kernels', 'net_tx_bytes')
    op.drop_column('kernels', 'net_rx_bytes')
    op.drop_column('kernels', 'max_mem_bytes')
    op.drop_column('kernels', 'io_write_bytes')
    op.drop_column('kernels', 'io_read_bytes')
    op.drop_column('kernels', 'cur_mem_bytes')
    op.drop_column('kernels', 'cpu_used')
    op.drop_column('kernels', 'allocated_cores')
    op.drop_column('kernels', 'agent')
    op.create_table(
        'usage',
        sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False),
        sa.Column('access_key_id', sa.VARCHAR(length=20), autoincrement=False, nullable=True),
        sa.Column('kernel_type', sa.VARCHAR(), autoincrement=False, nullable=True),
        sa.Column('kernel_id', sa.VARCHAR(), autoincrement=False, nullable=True),
        sa.Column('started_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
        sa.Column('terminated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True),
        sa.Column('cpu_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('mem_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('io_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.Column('net_used', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True),
        sa.ForeignKeyConstraint(['access_key_id'], ['keypairs.access_key'], name='fk_usage_access_key_id_keypairs'),
        sa.PrimaryKeyConstraint('id', name='pk_usage')
    )
    op.drop_table('vfolder_attachment')
    op.drop_table('vfolders')
    op.drop_table('agents')
    # ### end Alembic commands ### 
Example 52
Project: backend.ai-manager   Author: lablup   File: 185852ff9872_add_vfolder_permissions_table.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'vfolder_permissions',
        sa.Column('permission', sa.String(length=2), nullable=True),
        sa.Column('vfolder', GUID(), nullable=False),
        sa.Column('access_key', sa.String(length=20), nullable=False),
        sa.ForeignKeyConstraint(['access_key'], ['keypairs.access_key'],
                                name=op.f('fk_vfolder_permissions_access_key_keypairs')),
        sa.ForeignKeyConstraint(['vfolder'], ['vfolders.id'],
                                name=op.f('fk_vfolder_permissions_vfolder_vfolders'),
                                onupdate='CASCADE', ondelete='CASCADE')
    )
    # ### end Alembic commands ### 
Example 53
Project: backend.ai-manager   Author: lablup   File: 7a82e0c70122_add_group_model.py    GNU Lesser General Public License v3.0 5 votes vote down vote up
def upgrade():
    op.create_table(
        'groups',
        sa.Column('id', GUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
        sa.Column('name', sa.String(length=64), nullable=False),
        sa.Column('description', sa.String(length=512), nullable=True),
        sa.Column('is_active', sa.Boolean(), nullable=True),
        sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.Column('modified_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.Column('domain_name', sa.String(length=64), nullable=False),
        sa.ForeignKeyConstraint(['domain_name'], ['domains.name'],
                                name=op.f('fk_groups_domain_name_domains'),
                                onupdate='CASCADE', ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_groups')),
        sa.UniqueConstraint('name', 'domain_name', name='uq_groups_name_domain_name')
    )
    op.create_index(op.f('ix_groups_domain_name'), 'groups', ['domain_name'], unique=False)
    op.create_table(
        'association_groups_users',
        sa.Column('user_id',  GUID(), nullable=False),
        sa.Column('group_id', GUID(), nullable=False),
        sa.ForeignKeyConstraint(['group_id'], ['groups.id'],
                                name=op.f('fk_association_groups_users_group_id_groups'),
                                onupdate='CASCADE', ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['users.uuid'],
                                name=op.f('fk_association_groups_users_user_id_users'),
                                onupdate='CASCADE', ondelete='CASCADE'),
        sa.UniqueConstraint('user_id', 'group_id', name='uq_association_user_id_group_id')
    ) 
Example 54
Project: networking-sfc   Author: openstack   File: 9768e6a66c9_flowclassifier_data_model.py    Apache License 2.0 5 votes vote down vote up
def upgrade():
    op.create_table(
        'sfc_flow_classifiers',
        sa.Column('tenant_id', sa.String(length=255),
                  nullable=True, index=True),
        sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('name', sa.String(length=255), nullable=True),
        sa.Column('ethertype', sa.String(length=40), nullable=True),
        sa.Column('protocol', sa.String(length=40), nullable=True),
        sa.Column('description', sa.String(length=255),
                  nullable=True),
        sa.Column('source_port_range_min', sa.Integer(), nullable=True),
        sa.Column('source_port_range_max', sa.Integer(), nullable=True),
        sa.Column('destination_port_range_min', sa.Integer(), nullable=True),
        sa.Column('destination_port_range_max', sa.Integer(), nullable=True),
        sa.Column('source_ip_prefix', sa.String(length=255), nullable=True),
        sa.Column('destination_ip_prefix', sa.String(length=255),
                  nullable=True),
        sa.Column('logical_source_port', sa.String(length=36),
                  nullable=False),
        sa.Column('logical_destination_port', sa.String(length=36),
                  nullable=True),
        sa.ForeignKeyConstraint(['logical_source_port'], ['ports.id'],
                                ondelete='RESTRICT'),
        sa.ForeignKeyConstraint(['logical_destination_port'], ['ports.id'],
                                ondelete='RESTRICT'),
        sa.PrimaryKeyConstraint('id')
    )

    op.create_table(
        'sfc_flow_classifier_l7_parameters',
        sa.Column('keyword', sa.String(length=255), nullable=False),
        sa.Column('value', sa.String(length=255), nullable=True),
        sa.Column('classifier_id', sa.String(length=36), nullable=False),
        sa.ForeignKeyConstraint(['classifier_id'],
                                ['sfc_flow_classifiers.id'], ),
        sa.PrimaryKeyConstraint('keyword', 'classifier_id')
    ) 
Example 55
Project: holepunch   Author: CypherpunkArmory   File: c8493c83258e_baseline.py    GNU Affero General Public License v3.0 5 votes vote down vote up
def upgrade():
    # docker exec holepunch_db_1 createdb -U postgres holepunch_development
    op.create_table(
        "user",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("email", sa.String(length=64), nullable=True),
        sa.Column("password_hash", sa.String(length=128), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_user_email"), "user", ["email"], unique=True)
    op.create_table(
        "subdomain",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=64), nullable=False, unique=True),
        sa.Column("user_id", sa.Integer(), nullable=True),
        sa.Column("reserved", sa.BOOLEAN, nullable=False),
        sa.Column("in_use", sa.BOOLEAN, nullable=False),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_subdomain_name"), "subdomain", ["name"], unique=True)
    op.create_table(
        "tunnel",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("tunnel_server", sa.String(length=64), nullable=False),
        sa.Column("tunnel_ssh_port", sa.Integer(), nullable=False),
        sa.Column("tunnel_connection_port", sa.Integer(), nullable=False),
        sa.Column("subdomain_id", sa.Integer(), nullable=False, unique=True),
        sa.Column("type", sa.String(length=16), nullable=False),
        sa.Column("subdomain_id", sa.Integer(), nullable=False, unique=True),
        sa.Column("user_id", sa.Integer(), nullable=False),
        sa.ForeignKeyConstraint(["user_id"], ["user.id"]),
        sa.ForeignKeyConstraint(["subdomain_id"], ["subdomain.id"]),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_index(op.f("ix_tunnel_id"), "tunnel", ["id"], unique=True)
    pass 
Example 56
Project: ara-archive   Author: dmsimard   File: 002_ara_record_data.py    GNU General Public License v3.0 5 votes vote down vote up
def upgrade():
    op.create_table('data',
    sa.Column('id', sa.String(length=36), nullable=False),
    sa.Column('playbook_id', sa.String(length=36), nullable=True),
    sa.Column('key', sa.String(length=255), nullable=True),
    sa.Column('value', models.CompressedData((2 ** 32) - 1), nullable=True),
    sa.ForeignKeyConstraint(['playbook_id'], ['playbooks.id'], ondelete='RESTRICT'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('playbook_id', 'key')
    )
    ### end Alembic commands ### 
Example 57
Project: kickerscore   Author: BigDataRepublic   File: b4312fa1e808_.py    Apache License 2.0 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('face_encoding',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('player_id', sa.String(length=16), nullable=True),
    sa.Column('encoding', sa.ARRAY(sa.Float()), nullable=True),
    sa.ForeignKeyConstraint(['player_id'], ['player.slack_id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 58
Project: authserver   Author: brighthive   File: 17af54db2ac2_.py    MIT License 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oauth2_client',
    sa.Column('client_id', sa.String(length=48), nullable=True),
    sa.Column('client_secret', sa.String(length=120), nullable=True),
    sa.Column('issued_at', sa.Integer(), nullable=False),
    sa.Column('expires_at', sa.Integer(), nullable=False),
    sa.Column('redirect_uri', sa.Text(), nullable=True),
    sa.Column('token_endpoint_auth_method', sa.String(length=48), nullable=True),
    sa.Column('grant_type', sa.Text(), nullable=False),
    sa.Column('response_type', sa.Text(), nullable=False),
    sa.Column('scope', sa.Text(), nullable=False),
    sa.Column('client_name', sa.String(length=100), nullable=True),
    sa.Column('client_uri', sa.Text(), nullable=True),
    sa.Column('logo_uri', sa.Text(), nullable=True),
    sa.Column('contact', sa.Text(), nullable=True),
    sa.Column('tos_uri', sa.Text(), nullable=True),
    sa.Column('policy_uri', sa.Text(), nullable=True),
    sa.Column('jwks_uri', sa.Text(), nullable=True),
    sa.Column('jwks_text', sa.Text(), nullable=True),
    sa.Column('i18n_metadata', sa.Text(), nullable=True),
    sa.Column('software_id', sa.String(length=36), nullable=True),
    sa.Column('software_version', sa.String(length=48), nullable=True),
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_oauth2_client_client_id'), 'oauth2_client', ['client_id'], unique=False)
    # ### end Alembic commands ### 
Example 59
Project: authserver   Author: brighthive   File: 4eea6d5ae1ee_.py    MIT License 5 votes vote down vote up
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oauth2_client',
    sa.Column('client_id', sa.VARCHAR(length=48), autoincrement=False, nullable=True),
    sa.Column('client_secret', sa.VARCHAR(length=120), autoincrement=False, nullable=True),
    sa.Column('issued_at', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('expires_at', sa.INTEGER(), autoincrement=False, nullable=False),
    sa.Column('redirect_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('token_endpoint_auth_method', sa.VARCHAR(length=48), autoincrement=False, nullable=True),
    sa.Column('grant_type', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('response_type', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('scope', sa.TEXT(), autoincrement=False, nullable=False),
    sa.Column('client_name', sa.VARCHAR(length=100), autoincrement=False, nullable=True),
    sa.Column('client_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('logo_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('contact', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('tos_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('policy_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('jwks_uri', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('jwks_text', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('i18n_metadata', sa.TEXT(), autoincrement=False, nullable=True),
    sa.Column('software_id', sa.VARCHAR(length=36), autoincrement=False, nullable=True),
    sa.Column('software_version', sa.VARCHAR(length=48), autoincrement=False, nullable=True),
    sa.Column('id', sa.VARCHAR(), autoincrement=False, nullable=False),
    sa.Column('user_id', sa.VARCHAR(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], name='oauth2_client_user_id_fkey', ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id', name='oauth2_client_pkey')
    )
    op.create_index('ix_oauth2_client_client_id', 'oauth2_client', ['client_id'], unique=False)
    op.drop_index(op.f('ix_oauth2_tokens_refresh_token'), table_name='oauth2_tokens')
    op.drop_table('oauth2_tokens')
    op.drop_index(op.f('ix_oauth2_clients_client_id'), table_name='oauth2_clients')
    op.drop_table('oauth2_clients')
    op.drop_table('oauth2_authorization_codes')
    # ### end Alembic commands ### 
Example 60
Project: FXTest   Author: liwanlei   File: 6c1c070f3663_.py    MIT License 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('userloginlog',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user', sa.Integer(), nullable=True),
    sa.Column('ip', sa.String(length=252), nullable=True),
    sa.Column('datatime', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['user'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    ) 
Example 61
Project: intercom-rank   Author: uploadcare   File: 9e1f061d7b98_.py    MIT License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('intercom_user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('project_id', sa.Integer(), nullable=False),
    sa.Column('domain', sa.Unicode(length=255), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('is_useful_domain', sa.Boolean(), nullable=False),
    sa.ForeignKeyConstraint(['project_id'], ['projects.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index('project_domain_index', 'intercom_user', ['project_id', 'domain'], unique=False)
    op.create_index('project_user_index', 'intercom_user', ['project_id', 'user_id'], unique=True)
    ### end Alembic commands ### 
Example 62
Project: Erasmus   Author: bryanforbes   File: 85d51f96a1cd_add_guild_prefs.py    BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'guild_prefs',
        sa.Column('guild_id', botus_receptus.gino.base.Snowflake(), nullable=False),
        sa.Column('bible_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(['bible_id'], ['bible_versions.id']),
        sa.PrimaryKeyConstraint('guild_id'),
    )
    # ### end Alembic commands ### 
Example 63
Project: sqlalchemy-hana   Author: SAP   File: test_suite.py    Apache License 2.0 5 votes vote down vote up
def test_get_foreign_key_options(self):
        # this tests needs to be overwritten, because
        # In no case in SQLAlchemy-hana an empty dictionary is returned for foreign key options.
        # Also if the user does not explicitly mention the referential actions to be used in the
        # create table statement, the default values of the referential actions in HANA (RESTRICT) are reflected.
        meta = self.metadata

        Table(
            'x', meta,
            Column('id', Integer, primary_key=True),
            test_needs_fk=True
        )

        Table('table', meta,
              Column('id', Integer, primary_key=True),
              Column('x_id', Integer, sa.ForeignKey('x.id', name='xid')),
              Column('test', String(10)),
              test_needs_fk=True)

        Table('user', meta,
              Column('id', Integer, primary_key=True),
              Column('name', String(50), nullable=False),
              Column('tid', Integer),
              sa.ForeignKeyConstraint(
                  ['tid'], ['table.id'],
                  name='myfk',
                  onupdate="SET NULL", ondelete="CASCADE"),
                  test_needs_fk=True)

        meta.create_all()

        insp = inspect(meta.bind)

        opts = insp.get_foreign_keys('user')[0]['options']
        eq_(
            dict(
                (k, opts[k])
                for k in opts if opts[k]
            ),
            {'onupdate': 'SET NULL', 'ondelete': 'CASCADE'}
        ) 
Example 64
Project: SempoBlockchain   Author: teamsempo   File: 3ceb7f507cd0_.py    GNU General Public License v3.0 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('blockchain_transaction',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('submitted_date', sa.DateTime(), nullable=True),
    sa.Column('added_date', sa.DateTime(), nullable=True),
    sa.Column('hash', sa.String(), nullable=True),
    sa.Column('credit_transfer_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['credit_transfer_id'], ['credit_transfer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.add_column('public_serial_number', sa.Column('nfc_serial_number', sa.String(), nullable=True))
    # ### end Alembic commands ### 
Example 65
Project: SempoBlockchain   Author: teamsempo   File: 5c76f2801635_.py    GNU General Public License v3.0 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('uploaded_image',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('filename', sa.String(), nullable=True),
    sa.Column('credit_transfer_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['credit_transfer_id'], ['credit_transfer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.drop_column('chatbot_state', 'source_preference')
    # ### end Alembic commands ### 
Example 66
Project: SempoBlockchain   Author: teamsempo   File: 4ae231d6ddb3_.py    GNU General Public License v3.0 5 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('ip_address',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('_ip', postgresql.INET(), nullable=True),
    sa.Column('country', sa.String(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 67
Project: circleci-demo-python-flask   Author: CircleCI-Public   File: 7257da855061_.py    MIT License 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('roles',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('default', sa.Boolean(), nullable=True),
    sa.Column('permissions', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_index(op.f('ix_roles_default'), 'roles', ['default'], unique=False)
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('email', sa.String(length=64), nullable=True),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('role_id', sa.Integer(), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('confirmed', sa.Boolean(), nullable=True),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('location', sa.String(length=64), nullable=True),
    sa.Column('about_me', sa.Text(), nullable=True),
    sa.Column('member_since', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('avatar_hash', sa.String(length=32), nullable=True),
    sa.ForeignKeyConstraint(['role_id'], ['roles.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=True)
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=True)
    op.create_table('follows',
    sa.Column('follower_id', sa.Integer(), nullable=False),
    sa.Column('followed_id', sa.Integer(), nullable=False),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['followed_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['follower_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('follower_id', 'followed_id')
    )
    op.create_table('posts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('body_html', sa.Text(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('author_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_posts_timestamp'), 'posts', ['timestamp'], unique=False)
    op.create_table('comments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('body', sa.Text(), nullable=True),
    sa.Column('body_html', sa.Text(), nullable=True),
    sa.Column('timestamp', sa.DateTime(), nullable=True),
    sa.Column('disabled', sa.Boolean(), nullable=True),
    sa.Column('author_id', sa.Integer(), nullable=True),
    sa.Column('post_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['author_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['post_id'], ['posts.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_comments_timestamp'), 'comments', ['timestamp'], unique=False)
    # ### end Alembic commands ### 
Example 68
Project: gitlab-tools   Author: Salamek   File: 19e8725e0581_.py    GNU General Public License v3.0 4 votes vote down vote up
def upgrade():
    bind = op.get_bind()
    session = Session(bind=bind)

    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('project',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('gitlab_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('name_with_namespace', sa.String(length=255), nullable=True),
    sa.Column('web_url', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('gitlab_id')
    )
    op.create_table('push_mirror',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('source', sa.String(length=255), nullable=True),
    sa.Column('target', sa.String(length=255), nullable=True),
    sa.Column('foreign_vcs_type', sa.Integer(), nullable=True),
    sa.Column('last_sync', sa.DateTime(), nullable=True),
    sa.Column('note', sa.String(length=255), nullable=True),
    sa.Column('hook_token', sa.String(length=255), nullable=True),
    sa.Column('is_force_update', sa.Boolean(), nullable=True),
    sa.Column('is_prune_mirrors', sa.Boolean(), nullable=True),
    sa.Column('is_deleted', sa.Boolean(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('project_mirror', sa.String(length=255), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('project_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['project_id'], ['project.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_push_mirror_project_id'), 'push_mirror', ['project_id'], unique=False)
    op.create_index(op.f('ix_push_mirror_user_id'), 'push_mirror', ['user_id'], unique=False)
    op.add_column('pull_mirror', sa.Column('project_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_pull_mirror_project_id'), 'pull_mirror', ['project_id'], unique=False)
    op.create_foreign_key(None, 'pull_mirror', 'project', ['project_id'], ['id'])

    # Migrate dropped gitlab_id to project_id

    for pull_mirror in session.query(PullMirror):
        found_project = session.query(Project).filter_by(gitlab_id=pull_mirror.gitlab_id).first()
        if not found_project:
            found_project = Project()
            found_project.gitlab_id = pull_mirror.gitlab_id
            found_project.name = pull_mirror.project_name
            session.add(found_project)
            session.commit()

        pull_mirror.project_id = found_project.id

        session.add(pull_mirror)
    session.commit()

    op.drop_column('pull_mirror', 'gitlab_id')
    # ### end Alembic commands ### 
Example 69
Project: gitlab-tools   Author: Salamek   File: 6ea24c49b7a1_.py    GNU General Public License v3.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('crontab_schedule',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('minute', sa.String(length=120), nullable=True),
    sa.Column('hour', sa.String(length=120), nullable=True),
    sa.Column('day_of_week', sa.String(length=120), nullable=True),
    sa.Column('day_of_month', sa.String(length=120), nullable=True),
    sa.Column('month_of_year', sa.String(length=120), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('interval_schedule',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('every', sa.Integer(), nullable=False),
    sa.Column('period', sa.Unicode(length=255), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('periodic_tasks',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('ident', sa.Integer(), nullable=True),
    sa.Column('last_update', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_periodic_tasks_ident'), 'periodic_tasks', ['ident'], unique=False)
    op.create_table('periodic_task',
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=120), nullable=True),
    sa.Column('task', sa.String(length=120), nullable=True),
    sa.Column('crontab_id', sa.Integer(), nullable=True),
    sa.Column('interval_id', sa.Integer(), nullable=True),
    sa.Column('args', sa.String(length=120), nullable=True),
    sa.Column('kwargs', sa.String(length=120), nullable=True),
    sa.Column('last_run_at', sa.DateTime(), nullable=True),
    sa.Column('total_run_count', sa.Integer(), nullable=True),
    sa.Column('enabled', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['crontab_id'], ['crontab_schedule.id'], ),
    sa.ForeignKeyConstraint(['interval_id'], ['interval_schedule.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    # ### end Alembic commands ### 
Example 70
Project: quiz-extensions   Author: ucfopen   File: 203dd50e5775_.py    MIT License 4 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('course',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('canvas_id', sa.Integer(), nullable=True),
    sa.Column('course_name', sa.String(length=250), nullable=True),
    sa.Column('created_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('last_updated_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('canvas_id')
    )
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('canvas_id', sa.Integer(), nullable=True),
    sa.Column('created_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('last_updated_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('sis_id', sa.String(length=50), nullable=True),
    sa.Column('sortable_name', sa.String(length=250), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('canvas_id')
    )
    op.create_table('extension',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('course_id', sa.Integer(), nullable=True),
    sa.Column('created_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('last_updated_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('percent', sa.Integer(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.CheckConstraint(u'percent >= 100', name='check_percent_greater_than_100'),
    sa.ForeignKeyConstraint(['course_id'], ['course.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('quiz',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('canvas_id', sa.Integer(), nullable=True),
    sa.Column('course_id', sa.Integer(), nullable=True),
    sa.Column('created_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('last_updated_date', sa.DateTime(), server_default=sa.text(u'now()'), nullable=True),
    sa.Column('title', sa.String(length=250), nullable=True),
    sa.ForeignKeyConstraint(['course_id'], ['course.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('canvas_id')
    )
    ### end Alembic commands ### 
Example 71
Project: backend.ai-manager   Author: lablup   File: 7ea324d0535b_vfolder_and_kernel.py    GNU Lesser General Public License v3.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'agents',
        sa.Column('id', sa.String(length=64), nullable=False),
        sa.Column('mem_slots', sa.Integer(), nullable=False),
        sa.Column('cpu_slots', sa.Integer(), nullable=False),
        sa.Column('gpu_slots', sa.Integer(), nullable=False),
        sa.Column('used_mem_slots', sa.Integer(), nullable=False),
        sa.Column('used_cpu_slots', sa.Integer(), nullable=False),
        sa.Column('used_gpu_slots', sa.Integer(), nullable=False),
        sa.Column('addr', sa.String(length=128), nullable=False),
        sa.Column('first_contact', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_agents'))
    )
    op.create_table(
        'vfolders',
        sa.Column('id', GUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
        sa.Column('host', sa.String(length=128), nullable=False),
        sa.Column('name', sa.String(length=64), nullable=False),
        sa.Column('max_files', sa.Integer(), nullable=True),
        sa.Column('max_size', sa.Integer(), nullable=True),
        sa.Column('num_files', sa.Integer(), nullable=True),
        sa.Column('cur_size', sa.Integer(), nullable=True),
        sa.Column('created_at', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=True),
        sa.Column('last_used', sa.DateTime(timezone=True), nullable=True),
        sa.Column('belongs_to', sa.String(length=20), nullable=False),
        sa.ForeignKeyConstraint(['belongs_to'], ['keypairs.access_key'], name=op.f('fk_vfolders_belongs_to_keypairs')),
        sa.PrimaryKeyConstraint('id', name=op.f('pk_vfolders'))
    )
    op.create_table(
        'vfolder_attachment',
        sa.Column('vfolder', GUID(), nullable=False),
        sa.Column('kernel', GUID(), nullable=False),
        sa.ForeignKeyConstraint(['kernel'], ['kernels.sess_id'], name=op.f('fk_vfolder_attachment_kernel_kernels')),
        sa.ForeignKeyConstraint(['vfolder'], ['vfolders.id'], name=op.f('fk_vfolder_attachment_vfolder_vfolders')),
        sa.PrimaryKeyConstraint('vfolder', 'kernel', name=op.f('pk_vfolder_attachment'))
    )
    op.drop_table('usage')
    op.add_column('kernels', sa.Column('agent', sa.String(length=64), nullable=True))
    op.add_column('kernels', sa.Column('allocated_cores', sa.ARRAY(sa.Integer()), nullable=True))
    op.add_column('kernels', sa.Column('cpu_used', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('cur_mem_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('io_read_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('io_write_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('max_mem_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('net_rx_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('net_tx_bytes', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('num_queries', sa.BigInteger(), nullable=True))
    op.add_column('kernels', sa.Column('status_info', sa.Unicode(), nullable=True))
    op.create_index(op.f('ix_kernels_created_at'), 'kernels', ['created_at'], unique=False)
    op.create_index(op.f('ix_kernels_status'), 'kernels', ['status'], unique=False)
    op.create_index(op.f('ix_kernels_terminated_at'), 'kernels', ['terminated_at'], unique=False)
    op.create_foreign_key(op.f('fk_kernels_agent_agents'), 'kernels', 'agents', ['agent'], ['id'])
    op.drop_column('kernels', 'agent_id')
    # ### end Alembic commands ### 
Example 72
Project: backend.ai-manager   Author: lablup   File: 5de06da3c2b5_init.py    GNU Lesser General Public License v3.0 4 votes vote down vote up
def upgrade():
    op.execute('CREATE EXTENSION IF NOT EXISTS "uuid-ossp";')
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'keypairs',
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.Column('access_key', sa.String(length=20), nullable=False),
        sa.Column('secret_key', sa.String(length=40), nullable=True),
        sa.Column('is_active', sa.Boolean(), nullable=True),
        sa.Column('billing_plan', sa.String(), nullable=True),
        sa.Column('created_at', sa.DateTime(timezone=True),
                  server_default=sa.text('now()'), nullable=True),
        sa.Column('last_used', sa.DateTime(timezone=True), nullable=True),
        sa.Column('concurrency_limit', sa.Integer(), nullable=True),
        sa.Column('concurrency_used', sa.Integer(), nullable=True),
        sa.Column('rate_limit', sa.Integer(), nullable=True),
        sa.Column('num_queries', sa.Integer(), server_default='0', nullable=True),
        sa.PrimaryKeyConstraint('access_key')
    )
    op.create_table(
        'kernels',
        sa.Column('sess_id', GUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
        sa.Column('lang', sa.String(length=64), nullable=True),
        sa.Column('access_key', sa.String(length=20), nullable=True),
        sa.Column('created_at', sa.DateTime(timezone=True),
                  server_default=sa.text('now()'), nullable=True),
        sa.Column('terminated_at', sa.DateTime(timezone=True), nullable=True),
        sa.Column('status', sa.String(), nullable=True),
        sa.Column('agent_id', sa.String(), nullable=True),
        sa.Column('container_id', sa.String(), nullable=True),
        sa.ForeignKeyConstraint(['access_key'], ['keypairs.access_key'], ),
        sa.PrimaryKeyConstraint('sess_id')
    )
    op.create_table(
        'usage',
        sa.Column('id', GUID(), server_default=sa.text('uuid_generate_v4()'), nullable=False),
        sa.Column('access_key_id', sa.String(length=20), nullable=True),
        sa.Column('kernel_type', sa.String(), nullable=True),
        sa.Column('kernel_id', sa.String(), nullable=True),
        sa.Column('started_at', sa.DateTime(timezone=True), nullable=True),
        sa.Column('terminated_at', sa.DateTime(timezone=True), nullable=True),
        sa.Column('cpu_used', sa.Integer(), server_default='0', nullable=True),
        sa.Column('mem_used', sa.Integer(), server_default='0', nullable=True),
        sa.Column('io_used', sa.Integer(), server_default='0', nullable=True),
        sa.Column('net_used', sa.Integer(), server_default='0', nullable=True),
        sa.ForeignKeyConstraint(['access_key_id'], ['keypairs.access_key'], ),
        sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ### 
Example 73
Project: networking-sfc   Author: openstack   File: 53ed5bec6cff_add_service_graph_api_resource.py    Apache License 2.0 4 votes vote down vote up
def upgrade():
    op.create_table('sfc_service_graphs',
                    sa.Column('project_id',
                              sa.String(length=255),
                              nullable=True),
                    sa.Column('id',
                              sa.String(length=36),
                              nullable=False),
                    sa.Column('name',
                              sa.String(length=255),
                              nullable=True),
                    sa.Column('description',
                              sa.String(length=255),
                              nullable=True),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_engine='InnoDB')
    op.create_index(op.f('ix_sfc_service_graphs_project_id'),
                    'sfc_service_graphs',
                    ['project_id'],
                    unique=False)
    op.create_table('sfc_service_graph_chain_associations',
                    sa.Column('service_graph_id',
                              sa.String(length=36),
                              nullable=False),
                    sa.Column('src_chain',
                              sa.String(length=36),
                              nullable=False),
                    sa.Column('dst_chain',
                              sa.String(length=36),
                              nullable=False),
                    sa.ForeignKeyConstraint(['dst_chain'],
                                            ['sfc_port_chains.id'],
                                            ondelete='RESTRICT'),
                    sa.ForeignKeyConstraint(['service_graph_id'],
                                            ['sfc_service_graphs.id'],
                                            ondelete='CASCADE'),
                    sa.ForeignKeyConstraint(['src_chain'],
                                            ['sfc_port_chains.id'],
                                            ondelete='RESTRICT'),
                    sa.PrimaryKeyConstraint('service_graph_id',
                                            'src_chain',
                                            'dst_chain'),
                    mysql_engine='InnoDB') 
Example 74
Project: rucio   Author: rucio   File: history.py    Apache License 2.0 4 votes vote down vote up
def _history_mapper(local_mapper):
    cls = local_mapper.class_

    # set the "active_history" flag
    # on on column-mapped attributes so that the old version
    # of the info is always loaded (currently sets it on all attributes)
    for prop in local_mapper.iterate_properties:
        getattr(local_mapper.class_, prop.key).impl.active_history = True

    super_mapper = local_mapper.inherits
    super_history_mapper = getattr(cls, '__history_mapper__', None)

    polymorphic_on = None
    super_fks = []
    if not super_mapper or local_mapper.local_table is not super_mapper.local_table:
        cols = []
        for column in local_mapper.local_table.c:

            if column.name == 'updated_at':
                column.primary_key = True

            col = column.copy()
            col.unique = False

            if super_mapper and col_references_table(column, super_mapper.local_table):
                super_fks.append((col.key, list(super_history_mapper.local_table.primary_key)[0]))

            cols.append(col)

            if column is local_mapper.polymorphic_on:
                polymorphic_on = col

        if super_fks:
            cols.append(ForeignKeyConstraint(*list(zip(*super_fks))))

        table = Table(local_mapper.local_table.name + '_history', local_mapper.local_table.metadata, *cols)
    else:
        # single table inheritance.  take any additional columns that may have
        # been added and add them to the history table.
        for column in local_mapper.local_table.c:
            if column.key not in super_history_mapper.local_table.c:
                col = column.copy()
                col.unique = False
                super_history_mapper.local_table.append_column(col)
        table = None

    if super_history_mapper:
        bases = (super_history_mapper.class_,)
    else:
        bases = local_mapper.base_mapper.class_.__bases__
    versioned_cls = type.__new__(type, "%sHistory" % cls.__name__, bases, {})

    mapr = mapper(versioned_cls,
                  table,
                  inherits=super_history_mapper,
                  polymorphic_on=polymorphic_on,
                  polymorphic_identity=local_mapper.polymorphic_identity)
    cls.__history_mapper__ = mapr 
Example 75
Project: kickerscore   Author: BigDataRepublic   File: a4c56215d944_.py    Apache License 2.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('match',
                    sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('blue_points', sa.Integer(), nullable=True),
                    sa.Column('red_points', sa.Integer(), nullable=True),
                    sa.Column('predicted_win_prob_for_blue',
                              sa.Float(), nullable=True),
                    sa.Column('match_balance', sa.Float(), nullable=True),
                    sa.Column('date', sa.DateTime(), nullable=False),
                    sa.PrimaryKeyConstraint('id')
                    )
    op.create_table('player',
                    sa.Column('slack_id', sa.String(
                        length=16), nullable=False),
                    sa.Column('slack_username', sa.String(
                        length=64), nullable=True),
                    sa.Column('slack_avatar', sa.Text(), nullable=True),
                    sa.Column('registration_date',
                              sa.DateTime(), nullable=False),
                    sa.Column('active', sa.Boolean(), nullable=False),
                    sa.Column('rating_mu', sa.Float(), nullable=False),
                    sa.Column('rating_sigma', sa.Float(), nullable=False),
                    sa.Column('rating_mu_offense', sa.Float(), nullable=False),
                    sa.Column('rating_sigma_offense',
                              sa.Float(), nullable=False),
                    sa.Column('rating_mu_defense', sa.Float(), nullable=False),
                    sa.Column('rating_sigma_defense',
                              sa.Float(), nullable=False),
                    sa.PrimaryKeyConstraint('slack_id')
                    )
    op.create_table('match_participant',
                    sa.Column('user_id', sa.String(length=16), nullable=False),
                    sa.Column('match_id', sa.Integer(), nullable=False),
                    sa.Column('date', sa.DateTime(), nullable=False),
                    sa.Column('team', sa.String(length=4), nullable=True),
                    sa.Column('position', sa.String(length=7), nullable=True),
                    sa.Column('overall_skill_gain', sa.Float(), nullable=True),
                    sa.Column('offense_skill_gain', sa.Float(), nullable=True),
                    sa.Column('defense_skill_gain', sa.Float(), nullable=True),
                    sa.ForeignKeyConstraint(['match_id'], ['match.id'], ),
                    sa.ForeignKeyConstraint(
                        ['user_id'], ['player.slack_id'], ),
                    sa.PrimaryKeyConstraint('user_id', 'match_id')
                    )
    # ### end Alembic commands ### 
Example 76
Project: authserver   Author: brighthive   File: 4eea6d5ae1ee_.py    MIT License 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('oauth2_authorization_codes',
    sa.Column('code', sa.String(length=120), nullable=False),
    sa.Column('client_id', sa.String(length=48), nullable=True),
    sa.Column('redirect_uri', sa.Text(), nullable=True),
    sa.Column('response_type', sa.Text(), nullable=True),
    sa.Column('scope', sa.Text(), nullable=True),
    sa.Column('auth_time', sa.Integer(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('code')
    )
    op.create_table('oauth2_clients',
    sa.Column('client_id', sa.String(length=48), nullable=True),
    sa.Column('client_secret', sa.String(length=120), nullable=True),
    sa.Column('issued_at', sa.Integer(), nullable=False),
    sa.Column('expires_at', sa.Integer(), nullable=False),
    sa.Column('redirect_uri', sa.Text(), nullable=True),
    sa.Column('token_endpoint_auth_method', sa.String(length=48), nullable=True),
    sa.Column('grant_type', sa.Text(), nullable=False),
    sa.Column('response_type', sa.Text(), nullable=False),
    sa.Column('scope', sa.Text(), nullable=False),
    sa.Column('client_name', sa.String(length=100), nullable=True),
    sa.Column('client_uri', sa.Text(), nullable=True),
    sa.Column('logo_uri', sa.Text(), nullable=True),
    sa.Column('contact', sa.Text(), nullable=True),
    sa.Column('tos_uri', sa.Text(), nullable=True),
    sa.Column('policy_uri', sa.Text(), nullable=True),
    sa.Column('jwks_uri', sa.Text(), nullable=True),
    sa.Column('jwks_text', sa.Text(), nullable=True),
    sa.Column('i18n_metadata', sa.Text(), nullable=True),
    sa.Column('software_id', sa.String(length=36), nullable=True),
    sa.Column('software_version', sa.String(length=48), nullable=True),
    sa.Column('id', sa.String(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_oauth2_clients_client_id'), 'oauth2_clients', ['client_id'], unique=False)
    op.create_table('oauth2_tokens',
    sa.Column('client_id', sa.String(length=48), nullable=True),
    sa.Column('token_type', sa.String(length=40), nullable=True),
    sa.Column('access_token', sa.String(length=255), nullable=False),
    sa.Column('refresh_token', sa.String(length=255), nullable=True),
    sa.Column('scope', sa.Text(), nullable=True),
    sa.Column('revoked', sa.Boolean(), nullable=True),
    sa.Column('issued_at', sa.Integer(), nullable=False),
    sa.Column('expires_in', sa.Integer(), nullable=False),
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='CASCADE'),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('access_token')
    )
    op.create_index(op.f('ix_oauth2_tokens_refresh_token'), 'oauth2_tokens', ['refresh_token'], unique=False)
    op.drop_index('ix_oauth2_client_client_id', table_name='oauth2_client')
    op.drop_table('oauth2_client')
    # ### end Alembic commands ### 
Example 77
Project: Mahjong-Solitaire   Author: MEASHY   File: test_reflection.py    MIT License 4 votes vote down vote up
def test_get_foreign_key_options(self):
        meta = self.metadata

        Table(
            'x', meta,
            Column('id', Integer, primary_key=True),
            test_needs_fk=True
        )

        Table('table', meta,
              Column('id', Integer, primary_key=True),
              Column('x_id', Integer, sa.ForeignKey('x.id', name='xid')),
              Column('test', String(10)),
              test_needs_fk=True)

        Table('user', meta,
              Column('id', Integer, primary_key=True),
              Column('name', String(50), nullable=False),
              Column('tid', Integer),
              sa.ForeignKeyConstraint(
                  ['tid'], ['table.id'],
                  name='myfk',
                  onupdate="SET NULL", ondelete="CASCADE"),
              test_needs_fk=True)

        meta.create_all()

        insp = inspect(meta.bind)

        # test 'options' is always present for a backend
        # that can reflect these, since alembic looks for this
        opts = insp.get_foreign_keys('table')[0]['options']

        eq_(
            dict(
                (k, opts[k])
                for k in opts if opts[k]
            ),
            {}
        )

        opts = insp.get_foreign_keys('user')[0]['options']
        eq_(
            dict(
                (k, opts[k])
                for k in opts if opts[k]
            ),
            {'onupdate': 'SET NULL', 'ondelete': 'CASCADE'}
        ) 
Example 78
Project: Mahjong-Solitaire   Author: MEASHY   File: test_reflection.py    MIT License 4 votes vote down vote up
def test_get_foreign_key_options(self):
        meta = self.metadata

        Table(
            'x', meta,
            Column('id', Integer, primary_key=True),
            test_needs_fk=True
        )

        Table('table', meta,
              Column('id', Integer, primary_key=True),
              Column('x_id', Integer, sa.ForeignKey('x.id', name='xid')),
              Column('test', String(10)),
              test_needs_fk=True)

        Table('user', meta,
              Column('id', Integer, primary_key=True),
              Column('name', String(50), nullable=False),
              Column('tid', Integer),
              sa.ForeignKeyConstraint(
                  ['tid'], ['table.id'],
                  name='myfk',
                  onupdate="SET NULL", ondelete="CASCADE"),
              test_needs_fk=True)

        meta.create_all()

        insp = inspect(meta.bind)

        # test 'options' is always present for a backend
        # that can reflect these, since alembic looks for this
        opts = insp.get_foreign_keys('table')[0]['options']

        eq_(
            dict(
                (k, opts[k])
                for k in opts if opts[k]
            ),
            {}
        )

        opts = insp.get_foreign_keys('user')[0]['options']
        eq_(
            dict(
                (k, opts[k])
                for k in opts if opts[k]
            ),
            {'onupdate': 'SET NULL', 'ondelete': 'CASCADE'}
        ) 
Example 79
Project: SempoBlockchain   Author: teamsempo   File: e44e075decdf_.py    GNU General Public License v3.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('exchange',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('blockchain_task_id', sa.Integer(), nullable=True),
    sa.Column('to_desired_amount', sa.Integer(), nullable=True),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('from_token_id', sa.Integer(), nullable=True),
    sa.Column('to_token_id', sa.Integer(), nullable=True),
    sa.Column('from_transfer_id', sa.Integer(), nullable=True),
    sa.Column('to_transfer_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['from_token_id'], ['token.id'], ),
    sa.ForeignKeyConstraint(['from_transfer_id'], ['credit_transfer.id'], ),
    sa.ForeignKeyConstraint(['to_token_id'], ['token.id'], ),
    sa.ForeignKeyConstraint(['to_transfer_id'], ['credit_transfer.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('exchange_contract',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('blockchain_address', sa.String(), nullable=True),
    sa.Column('contract_registry_blockchain_address', sa.String(), nullable=True),
    sa.Column('subexchange_address_mapping', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.Column('reserve_token_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['reserve_token_id'], ['token.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_exchange_contract_blockchain_address'), 'exchange_contract', ['blockchain_address'], unique=False)
    op.create_index(op.f('ix_exchange_contract_contract_registry_blockchain_address'), 'exchange_contract', ['contract_registry_blockchain_address'], unique=False)
    op.create_table('exchange_contract_token_association_table',
    sa.Column('exchange_contract_id', sa.Integer(), nullable=True),
    sa.Column('token_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['exchange_contract_id'], ['exchange_contract.id'], ),
    sa.ForeignKeyConstraint(['token_id'], ['token.id'], )
    )
    op.add_column('blockchain_address', sa.Column('is_public', sa.Boolean(), nullable=True))
    op.add_column('credit_transfer', sa.Column('_transfer_amount_wei', sa.Numeric(precision=27), nullable=True))
    op.add_column('credit_transfer', sa.Column('is_public', sa.Boolean(), nullable=True))
    op.drop_column('credit_transfer', 'transfer_amount')
    op.add_column('email_whitelist', sa.Column('is_public', sa.Boolean(), nullable=True))
    op.add_column('transfer_account', sa.Column('_balance_wei', sa.Numeric(precision=27), nullable=True))
    op.add_column('transfer_account', sa.Column('exchange_contract_id', sa.Integer(), nullable=True))
    op.add_column('transfer_account', sa.Column('is_public', sa.Boolean(), nullable=True))
    op.create_foreign_key(None, 'transfer_account', 'exchange_contract', ['exchange_contract_id'], ['id'])
    op.drop_column('transfer_account', 'balance')
    op.add_column('user', sa.Column('is_public', sa.Boolean(), nullable=True))
    op.add_column('user', sa.Column('primary_blockchain_address', sa.String(), nullable=True))
    # ### end Alembic commands ### 
Example 80
Project: SempoBlockchain   Author: teamsempo   File: c37f48878815_.py    GNU General Public License v3.0 4 votes vote down vote up
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('business_verification',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('wyre_id', sa.String(), nullable=True),
    sa.Column('kyc_status', sa.String(), nullable=True),
    sa.Column('first_name', sa.String(), nullable=True),
    sa.Column('last_name', sa.String(), nullable=True),
    sa.Column('phone', sa.String(), nullable=True),
    sa.Column('business_legal_name', sa.String(), nullable=True),
    sa.Column('business_type', sa.String(), nullable=True),
    sa.Column('tax_id', sa.String(), nullable=True),
    sa.Column('website', sa.String(), nullable=True),
    sa.Column('date_established', sa.String(), nullable=True),
    sa.Column('country', sa.String(), nullable=True),
    sa.Column('street_address', sa.String(), nullable=True),
    sa.Column('street_address_2', sa.String(), nullable=True),
    sa.Column('city', sa.String(), nullable=True),
    sa.Column('region', sa.String(), nullable=True),
    sa.Column('postal_code', sa.Integer(), nullable=True),
    sa.Column('beneficial_owners', postgresql.JSON(astext_type=sa.Text()), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('bank_account',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('business_verification_id', sa.Integer(), nullable=True),
    sa.Column('bank_country', sa.String(), nullable=True),
    sa.Column('routing_number', sa.String(), nullable=True),
    sa.Column('account_number', sa.String(), nullable=True),
    sa.Column('currency', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['business_verification_id'], ['business_verification.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('uploaded_document',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('authorising_user_id', sa.Integer(), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('updated', sa.DateTime(), nullable=True),
    sa.Column('business_verification_id', sa.Integer(), nullable=True),
    sa.Column('filename', sa.String(), nullable=True),
    sa.Column('file_type', sa.String(), nullable=True),
    sa.Column('user_filename', sa.String(), nullable=True),
    sa.Column('reference', sa.String(), nullable=True),
    sa.ForeignKeyConstraint(['business_verification_id'], ['business_verification.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###