Python sqlalchemy.Column() Examples

The following are 30 code examples for showing how to use sqlalchemy.Column(). These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example.

You may check out the related API usage on the sidebar.

You may also want to check out all available functions/classes of the module sqlalchemy , or try the search function .

Example 1
Project: comport   Author: codeforamerica   File: 875c52a485_.py    License: BSD 3-Clause "New" or "Revised" License 6 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('months',
    sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('months_id_seq'::regclass)"), nullable=False),
    sa.Column('month', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('year', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('department_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['department_id'], ['departments.id'], name='months_department_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='months_pkey'),
    postgresql_ignore_search_path=False
    )
    op.create_table('serviceTypes',
    sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"serviceTypes_id_seq"\'::regclass)'), nullable=False),
    sa.Column('month_id', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.Column('service_type', sa.VARCHAR(length=36), autoincrement=False, nullable=False),
    sa.Column('count', sa.INTEGER(), autoincrement=False, nullable=True),
    sa.ForeignKeyConstraint(['month_id'], ['months.id'], name='serviceTypes_month_id_fkey'),
    sa.PrimaryKeyConstraint('id', name='serviceTypes_pkey')
    )
    op.drop_table('use_of_force_incidents')
    ### end Alembic commands ### 
Example 2
Project: comport   Author: codeforamerica   File: 33fcc9c4867_.py    License: 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    License: 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    License: 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: gnocchi   Author: gnocchixyz   File: sqlalchemy_base.py    License: Apache License 2.0 6 votes vote down vote up
def revision(cls):
        tablename_compact = cls.__tablename__
        if tablename_compact.endswith("_history"):
            tablename_compact = tablename_compact[:-6]
        return sqlalchemy.Column(
            sqlalchemy.Integer,
            sqlalchemy.ForeignKey(
                'resource_history.revision',
                ondelete="CASCADE",
                name="fk_%s_revision_rh_revision"
                % tablename_compact,
                # NOTE(sileht): We use to ensure that postgresql
                # does not use AccessExclusiveLock on destination table
                use_alter=True),
            primary_key=True
        ) 
Example 6
Project: gnocchi   Author: gnocchixyz   File: aba5a217ca9b_merge_created_in_creator.py    License: Apache License 2.0 6 votes vote down vote up
def upgrade():
    for table_name in ("resource", "resource_history", "metric"):
        creator_col = sa.Column("creator", sa.String(255))
        created_by_user_id_col = sa.Column("created_by_user_id",
                                           sa.String(255))
        created_by_project_id_col = sa.Column("created_by_project_id",
                                              sa.String(255))
        op.add_column(table_name, creator_col)
        t = sa.sql.table(
            table_name, creator_col,
            created_by_user_id_col, created_by_project_id_col)
        op.execute(
            t.update().values(
                creator=(
                    created_by_user_id_col + ":" + created_by_project_id_col
                )).where((created_by_user_id_col is not None)
                         | (created_by_project_id_col is not None)))
        op.drop_column(table_name, "created_by_user_id")
        op.drop_column(table_name, "created_by_project_id") 
Example 7
Project: gnocchi   Author: gnocchixyz   File: 0718ed97e5b3_add_tablename_to_resource_type.py    License: Apache License 2.0 6 votes vote down vote up
def upgrade():
    op.add_column("resource_type", sa.Column('tablename', sa.String(18),
                                             nullable=True))

    resource_type = sa.Table(
        'resource_type', sa.MetaData(),
        sa.Column('name', sa.String(255), nullable=False),
        sa.Column('tablename', sa.String(18), nullable=True)
    )
    op.execute(resource_type.update().where(
        resource_type.c.name == "instance_network_interface"
    ).values({'tablename': op.inline_literal("'instance_net_int'")}))
    op.execute(resource_type.update().where(
        resource_type.c.name != "instance_network_interface"
    ).values({'tablename': resource_type.c.name}))

    op.alter_column("resource_type", "tablename", type_=sa.String(18),
                    nullable=False)
    op.create_unique_constraint("uniq_resource_type0tablename",
                                "resource_type", ["tablename"]) 
Example 8
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('unavailable_room_report',
                    sa.Column('record_id', sa.Integer(), nullable=False),
                    sa.Column('room_id', sa.String(), nullable=True),
                    sa.Column('date', sa.Date(), nullable=True),
                    sa.Column('time', sa.String(length=4), nullable=True),
                    sa.Column('reporter', sa.String(length=15), nullable=True),
                    sa.Column('reporter_type', sa.String(), nullable=True),
                    sa.PrimaryKeyConstraint('record_id'),
                    sa.UniqueConstraint('room_id', 'date', 'time', 'reporter', 'reporter_type', name='unavailable_room_report_uniq')
                    )
    op.drop_index('idx_token', table_name='calendar_tokens')
    op.alter_column('identity_verify_requests', 'create_time',
                    existing_type=postgresql.TIMESTAMP(timezone=True),
                    nullable=True)
    op.create_index(op.f('ix_simple_passwords_time'), 'simple_passwords', ['time'], unique=False)
    op.drop_index('idx_host_time', table_name='visit_tracks')
    op.create_index('idx_host_time', 'visit_tracks', ['host_id', 'last_visit_time'], unique=False)
    # ### end Alembic commands ### 
Example 9
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 10
Project: comport   Author: codeforamerica   File: 4ffa73ef2b8_.py    License: 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 11
Project: comport   Author: codeforamerica   File: 1392585412d_.py    License: 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('departments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_index(op.f('ix_departments_id'), 'departments', ['id'], unique=False)
    ### end Alembic commands ### 
Example 12
Project: comport   Author: codeforamerica   File: ab97630e71ce_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.add_column('officer_involved_shootings_bpd', sa.Column('case_number', sa.String(length=255), nullable=True)) 
Example 13
Project: comport   Author: codeforamerica   File: 32d7cc46df4_.py    License: 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 14
Project: comport   Author: codeforamerica   File: 2de736b481_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('citizen_complaints', sa.Column('allegation', sa.String(length=255), nullable=True))
    op.add_column('citizen_complaints', sa.Column('allegation_type', sa.String(length=255), nullable=True))
    op.drop_column('citizen_complaints', 'category')
    ### end Alembic commands ### 
Example 15
Project: comport   Author: codeforamerica   File: 2de736b481_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('citizen_complaints', sa.Column('category', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.drop_column('citizen_complaints', 'allegation_type')
    op.drop_column('citizen_complaints', 'allegation')
    ### end Alembic commands ### 
Example 16
Project: comport   Author: codeforamerica   File: 507f3182b84_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('denominator_values', sa.Column('officers_out_on_service', sa.Integer(), nullable=True))
    op.drop_column('denominator_values', 'arrests')
    ### end Alembic commands ### 
Example 17
Project: comport   Author: codeforamerica   File: 507f3182b84_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('denominator_values', sa.Column('arrests', sa.INTEGER(), autoincrement=False, nullable=True))
    op.drop_column('denominator_values', 'officers_out_on_service')
    ### end Alembic commands ### 
Example 18
Project: comport   Author: codeforamerica   File: 1c306b9d32_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('use_of_force_incidents', sa.Column('received_date', sa.DateTime(), nullable=True))
    ### end Alembic commands ### 
Example 19
Project: comport   Author: codeforamerica   File: 7f4ae427dcf6_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.add_column('officer_involved_shootings_bpd', sa.Column('disposition', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.drop_column('officer_involved_shootings_bpd', 'has_disposition') 
Example 20
Project: comport   Author: codeforamerica   File: 0d39b8d2c5ce_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.add_column('chart_blocks', sa.Column('order', sa.Integer(), server_default='0', nullable=True)) 
Example 21
Project: comport   Author: codeforamerica   File: 2357b6b3d76_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('citizen_complaints', sa.Column('service_type', sa.String(length=255), nullable=True))
    op.add_column('citizen_complaints', sa.Column('source', sa.String(length=255), nullable=True))
    ### end Alembic commands ### 
Example 22
Project: comport   Author: codeforamerica   File: 77ad8047becf_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.add_column('use_of_force_incidents_bpd', sa.Column('case_number', sa.String(length=128), nullable=True))
    op.add_column('use_of_force_incidents_bpd', sa.Column('completed_date', sa.DateTime(), nullable=True))
    op.add_column('use_of_force_incidents_bpd', sa.Column('received_date', sa.DateTime(), nullable=True))

    op.drop_column('use_of_force_incidents_bpd', 'division')
    op.drop_column('use_of_force_incidents_bpd', 'bureau')
    op.drop_column('use_of_force_incidents_bpd', 'resident_weapon_used') 
Example 23
Project: comport   Author: codeforamerica   File: 77ad8047becf_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.add_column('use_of_force_incidents_bpd', sa.Column('resident_weapon_used', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents_bpd', sa.Column('bureau', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents_bpd', sa.Column('division', sa.VARCHAR(length=255), autoincrement=False, nullable=True))

    op.drop_column('use_of_force_incidents_bpd', 'received_date')
    op.drop_column('use_of_force_incidents_bpd', 'completed_date')
    op.drop_column('use_of_force_incidents_bpd', 'case_number') 
Example 24
Project: comport   Author: codeforamerica   File: 21dd34bbb19_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('use_of_force_incidents', sa.Column('status', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('day_of_week', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('received_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_injured', sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_weapon', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('citizen_hospitalized', sa.BOOLEAN(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('year', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('hour', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('use_of_force_incidents', sa.Column('month', sa.INTEGER(), autoincrement=False, nullable=True))
    op.alter_column('use_of_force_incidents', 'department_id',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.drop_column('use_of_force_incidents', 'shift')
    op.drop_column('use_of_force_incidents', 'resident_weapon_used')
    op.drop_column('use_of_force_incidents', 'resident_resist_type')
    op.drop_column('use_of_force_incidents', 'resident_race')
    op.drop_column('use_of_force_incidents', 'resident_injured')
    op.drop_column('use_of_force_incidents', 'resident_hospitalized')
    op.drop_column('use_of_force_incidents', 'precinct')
    op.drop_column('use_of_force_incidents', 'officer_race')
    op.drop_column('use_of_force_incidents', 'officer_force_type')
    op.drop_column('use_of_force_incidents', 'office_weapon_used')
    op.drop_column('use_of_force_incidents', 'division')
    op.drop_column('use_of_force_incidents', 'beat')
    ### end Alembic commands ### 
Example 25
Project: comport   Author: codeforamerica   File: 3df24031e72_.py    License: 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 26
Project: comport   Author: codeforamerica   File: cff7a8d7f106_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    op.add_column('officer_involved_shootings_bpd', sa.Column('division', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    op.add_column('officer_involved_shootings_bpd', sa.Column('bureau', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) 
Example 27
Project: comport   Author: codeforamerica   File: 28296e3a641_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('department_id', sa.Integer(), nullable=True))
    op.create_foreign_key(None, 'users', 'departments', ['department_id'], ['id'])
    ### end Alembic commands ### 
Example 28
Project: comport   Author: codeforamerica   File: 529cc76baaa_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('departments', sa.Column('what_this_is', sa.TEXT(), autoincrement=False, nullable=True))
    ### end Alembic commands ### 
Example 29
Project: comport   Author: codeforamerica   File: 23353b28d77_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('demographic_values', sa.Column('gender', sa.VARCHAR(length=255), autoincrement=False, nullable=True))
    ### end Alembic commands ### 
Example 30
Project: comport   Author: codeforamerica   File: 5cb851130ebb_.py    License: BSD 3-Clause "New" or "Revised" License 5 votes vote down vote up
def upgrade():
    op.add_column('citizen_complaints_srpd', sa.Column('officer_age', sa.String(length=255), nullable=True))
    op.add_column('citizen_complaints_srpd', sa.Column('officer_years_of_service', sa.String(length=255), nullable=True))
    op.add_column('officer_involved_shootings_srpd', sa.Column('officer_age', sa.String(length=255), nullable=True))
    op.add_column('officer_involved_shootings_srpd', sa.Column('officer_years_of_service', sa.String(length=255), nullable=True))
    op.add_column('pursuits_srpd', sa.Column('officer_age', sa.String(length=255), nullable=True))
    op.add_column('pursuits_srpd', sa.Column('officer_years_of_service', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents_srpd', sa.Column('officer_age', sa.String(length=255), nullable=True))
    op.add_column('use_of_force_incidents_srpd', sa.Column('officer_years_of_service', sa.String(length=255), nullable=True))