sqlalchemy.TEXT

Here are the examples of the python api sqlalchemy.TEXT taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

55 Examples 7

Page 1 Selected Page 2

Example 1

Project: socorro Source File: 355d0795af7f_add_lag_log_table.py
def upgrade():
    op.create_table(u'lag_log',
        sa.Column(u'replica_name', sa.TEXT(), nullable=False),
        sa.Column(u'moment', postgresql.TIMESTAMP(timezone=True), nullable=False),
        sa.Column(u'lag', sa.INTEGER(), nullable=False),
        sa.Column(u'master', sa.TEXT(), nullable=False)
    )

Example 2

Project: Skier Source File: skier_migrate_database_stuff.py
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('key', 'armored',
               existing_type=sa.TEXT(),
               nullable=False)
    op.drop_column('key', 'subkeys')
    op.drop_table('signature')

Example 3

Project: ReadableWebProxy Source File: cb674b790e4a_more_nu_stuff.py
Function: downgrade
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('nu_outbound_wrappers', sa.Column('target_url', sa.TEXT(), autoincrement=False, nullable=True))
    op.add_column('nu_outbound_wrappers', sa.Column('link_url', sa.TEXT(), autoincrement=False, nullable=True))
    op.add_column('nu_outbound_wrappers', sa.Column('container_page', sa.TEXT(), autoincrement=False, nullable=True))
    op.create_index('ix_nu_outbound_wrappers_link_url', 'nu_outbound_wrappers', ['link_url'], unique=False)
    op.create_index('ix_nu_outbound_wrappers_container_page', 'nu_outbound_wrappers', ['container_page'], unique=False)
    op.drop_index(op.f('ix_nu_outbound_wrappers_seriesname'), table_name='nu_outbound_wrappers')
    op.drop_index(op.f('ix_nu_outbound_wrappers_groupinfo'), table_name='nu_outbound_wrappers')
    op.drop_index(op.f('ix_nu_outbound_wrappers_client_key'), table_name='nu_outbound_wrappers')
    op.drop_index(op.f('ix_nu_outbound_wrappers_client_id'), table_name='nu_outbound_wrappers')
    op.drop_column('nu_outbound_wrappers', 'seriesname')
    op.drop_column('nu_outbound_wrappers', 'releaseinfo')
    op.drop_column('nu_outbound_wrappers', 'referrer')
    op.drop_column('nu_outbound_wrappers', 'outbound_wrapper')
    op.drop_column('nu_outbound_wrappers', 'groupinfo')
    op.drop_column('nu_outbound_wrappers', 'client_key')
    op.drop_column('nu_outbound_wrappers', 'client_id')
    op.drop_column('nu_outbound_wrappers', 'actual_target')

Example 4

Project: Mycodo Source File: 0b8ab36548bd_remove_pidsetpoints_table.py
Function: downgrade
def downgrade():
    op.create_table(
        'pidsetpoints',
        sa.Column('id', sa.TEXT,  unique=True, primary_key=True),
        sa.Column('pid_id', sa.TEXT),
        sa.Column('start_time', sa.TEXT),
        sa.Column('end_time', sa.TEXT),
        sa.Column('start_setpoint', sa.REAL),
        sa.Column('end_setpoint', sa.REAL)
    )

Example 5

Project: open-event-orga-server Source File: e702a5a988c2_.py
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('tracks', 'description',
               existing_type=sa.TEXT(),
               nullable=False)
    op.alter_column('session', 'long_abstract',
               existing_type=sa.TEXT(),
               nullable=False)

Example 6

Project: Mycodo Source File: 04303bc223c4_create_dynamic_pid_setpoint_table.py
Function: upgrade
def upgrade():
    op.create_table(
        'pidsetpoints',
        sa.Column('id', sa.TEXT, unique=True, primary_key=True, nullable=False),
        sa.Column('pid_id', sa.TEXT),
        sa.Column('start_time', sa.TEXT),
        sa.Column('end_time', sa.TEXT),
        sa.Column('start_setpoint', sa.REAL),
        sa.Column('end_setpoint', sa.REAL),
    )

Example 7

Project: socorro Source File: 191d0453cc07_making_reports_honor.py
def upgrade():
    op.execute('TRUNCATE signature_summary_device, signature_summary_graphics CASCADE')
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column(u'signature_summary_device', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_device', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_device', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    op.add_column(u'signature_summary_graphics', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_graphics', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'signature_summary_graphics', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    op.execute('ALTER TABLE signature_summary_graphics DROP CONSTRAINT signature_summary_graphics_pkey')
    op.execute('ALTER TABLE signature_summary_graphics ADD PRIMARY KEY (report_date, product_version_id, signature_id, graphics_device_id)')
    op.execute('ALTER TABLE signature_summary_device DROP CONSTRAINT signature_summary_device_pkey')
    op.execute('ALTER TABLE signature_summary_device ADD PRIMARY KEY (report_date, product_version_id, signature_id, android_device_id)')
    ### end Alembic commands ###
    load_stored_proc(op, ['update_signature_summary.sql',])

Example 8

Project: Mycodo Source File: efa3afc7d152_add_flash_lcd_to_sensor_conditional.py
def upgrade():
    with op.batch_alter_table("relayconditional") as batch_op:
        batch_op.add_column(sa.Column('flash_lcd', sa.TEXT))
    with op.batch_alter_table("sensorconditional") as batch_op:
        batch_op.add_column(sa.Column('flash_lcd', sa.TEXT))
    op.execute(
        '''
        UPDATE relayconditional
        SET flash_lcd=''
        WHERE flash_lcd IS NULL
        '''
    )
    op.execute(
        '''
        UPDATE sensorconditional
        SET flash_lcd=''
        WHERE flash_lcd IS NULL
        '''
    )

Example 9

Project: socorro Source File: 89ef86a3d57a_extend_missing_symbols.py
Function: upgrade
def upgrade():
    op.add_column(
        'missing_symbols',
        sa.Column(
            'code_file',
            sa.TEXT(),
            nullable=True,
        )
    )
    op.add_column(
        'missing_symbols',
        sa.Column(
            'code_id',
            sa.TEXT(),
            nullable=True,
        )
    )

Example 10

Project: rootio_web Source File: 3639bac661c0_link_person_to_netwo.py
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('radio_programtype', 'phone_functions',
               existing_type=sa.TEXT(),
               type_=sa.TEXT(),
               existing_nullable=False)
    op.alter_column('radio_programtype', 'definition',
               existing_type=sa.TEXT(),
               type_=sa.TEXT(),
               existing_nullable=False)

Example 11

Project: Mycodo Source File: c6efd02bdf96_add_adc_columns_to_sensor_table.py
def upgrade():
    with op.batch_alter_table("sensor") as batch_op:
        batch_op.add_column(sa.Column('adc_address', sa.TEXT))
        batch_op.add_column(sa.Column('adc_channel', sa.INT))
        batch_op.add_column(sa.Column('adc_resolution', sa.INT))
        batch_op.add_column(sa.Column('adc_measure', sa.TEXT))
        batch_op.add_column(sa.Column('adc_measure_units', sa.TEXT))
        batch_op.add_column(sa.Column('adc_volts_min', sa.REAL))
        batch_op.add_column(sa.Column('adc_volts_max', sa.REAL))
        batch_op.add_column(sa.Column('adc_units_min', sa.REAL))
        batch_op.add_column(sa.Column('adc_units_max', sa.REAL))
    op.execute(
        '''
        UPDATE sensor
        SET adc_address=''
        WHERE adc_address IS NULL
        '''
    )

Example 12

Project: Mycodo Source File: b0187b98a37e_add_pid_id_to_graph_table_for_graphing_.py
def upgrade():
    with op.batch_alter_table("graph") as batch_op:
        batch_op.add_column(sa.Column('pid_ids', sa.TEXT))
    op.execute(
        '''
        UPDATE graph
        SET pid_ids=''
        WHERE pid_ids IS NULL
        '''
    )

Example 13

Project: socorro Source File: 4d86b4efd25d_bug_864391_create_sk.py
Function: upgrade
def upgrade():
    op.create_table(u'skiplist',
        sa.Column(u'category', sa.TEXT(), nullable=False),
        sa.Column(u'rule', sa.TEXT(), nullable=False),
        sa.PrimaryKeyConstraint(u'category', u'rule')
    )

Example 14

Project: socorro Source File: 1f235c84eaed_bug_1025987_normalize_correlations_table.py
def downgrade():
    load_stored_proc(op, ['update_correlations_module.sql'])
    op.add_column(u'correlations_module', sa.Column('module_version', sa.TEXT(), nullable=False))
    op.add_column(u'correlations_module', sa.Column('module_name', sa.TEXT(), nullable=False))
    op.drop_column(u'correlations_module', 'module_id')
    op.drop_table('modules')

Example 15

Project: funnel Source File: 140c9b68d65b_team_model.py
def downgrade():
    op.add_column('user', sa.Column('description', sa.TEXT(), nullable=False, server_default=sa.text(u"''")))
    op.alter_column('user', 'description', server_default=None)

    op.drop_table('users_teams')
    op.drop_table('team')

Example 16

Project: ReadableWebProxy Source File: 3b631f898e9f_.py
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('raw_web_pages', 'fspath',
               existing_type=sa.TEXT(),
               nullable=True)
    op.drop_column('raw_web_pages', 'is_text')
    op.drop_column('raw_web_pages_version', 'is_text')

Example 17

Project: socorro Source File: 02da1335e26e_remove_unused_skiplist_table.py
Function: downgrade
def downgrade():
    op.create_table(
        u'skiplist',
        sa.Column(u'category', sa.TEXT(), nullable=False),
        sa.Column(u'rule', sa.TEXT(), nullable=False),
        sa.PrimaryKeyConstraint(u'category', u'rule')
    )

Example 18

Project: socorro Source File: 295087fb3159_fixes_bug_915246_adds_product_name_and_.py
def upgrade():
    op.execute("""
        TRUNCATE crash_adu_by_build_signature
    """)
    op.add_column(u'crash_adu_by_build_signature',
        sa.Column(u'product_name', sa.TEXT(), nullable=False)
    )

    load_stored_proc(op, ['update_crash_adu_by_build_signature.sql',
                          'backfill_crash_adu_by_build_signature.sql'])

    today = datetime.datetime.utcnow().strftime('%Y-%m-%d')
    for i in range(0,7):
        op.execute("""
            SELECT backfill_crash_adu_by_build_signature(
                ('%s'::date - '%s days'::interval)::date
            )
        """  % (today, i))

Example 19

Project: Mycodo Source File: 0c69ae36f0d3_add_remote_host_options.py
def upgrade():
    op.create_table(
        'remote',
        sa.Column('id', sa.TEXT,  unique=True, primary_key=True),
        sa.Column('activated', sa.INT),
        sa.Column('host', sa.TEXT),
        sa.Column('username', sa.TEXT),
        sa.Column('password_hash', sa.TEXT)
    )
    with op.batch_alter_table("displayorder") as batch_op:
        batch_op.add_column(sa.Column('remote_host', sa.TEXT))
    op.execute(
        '''
        UPDATE displayorder
        SET remote_host=''
        WHERE remote_host IS NULL
        '''
    )

Example 20

Project: socorro Source File: 4b2567293aee_bug_974726_move_correlations_to_postgres.py
def downgrade():
    load_stored_proc(op, ['backfill_matviews.sql',
                          'update_correlations_addon.sql',
                          'update_correlations_core.sql',
                          'update_correlations_module.sql'])
    op.drop_index('ix_correlations_module_signature_id', table_name='correlations_module')
    op.drop_index('ix_correlations_module_report_date', table_name='correlations_module')
    op.drop_table(u'correlations_module')
    op.drop_index('ix_correlations_addon_signature_id', table_name='correlations_addon')
    op.drop_index('ix_correlations_addon_report_date', table_name='correlations_addon')
    op.drop_table(u'correlations_addon')
    op.drop_index('ix_correlations_core_signature_id', table_name='correlations_core')
    op.drop_index('ix_correlations_core_report_date', table_name='correlations_core')
    op.drop_table(u'correlations_core')
    op.create_table(u'correlation_cores', sa.Column(u'dummy', sa.TEXT(), nullable=False))
    op.create_table(u'correlation_modules', sa.Column(u'dummy', sa.TEXT(), nullable=False))
    op.create_table(u'correlation_addons', sa.Column(u'dummy', sa.TEXT(), nullable=False))
    op.create_table(u'correlations', sa.Column(u'dummy', sa.TEXT(), nullable=False))

Example 21

Project: socorro Source File: 3a5471a358bf_adding_a_migration_f.py
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.execute('TRUNCATE exploitability_reports CASCADE');
    op.add_column(u'exploitability_reports', sa.Column(u'version_string', sa.TEXT(), nullable=True))
    op.add_column(u'exploitability_reports', sa.Column(u'product_name', sa.TEXT(), nullable=True))
    op.add_column(u'exploitability_reports', sa.Column(u'product_version_id', sa.INTEGER(), nullable=False))
    ### end Alembic commands ###
    load_stored_proc(op, ['update_exploitability.sql'])
        
    for i in range(15, 30):
        backfill_date = '2013-11-%s' % i
        op.execute("""
            SELECT backfill_exploitability('%s')
        """ % backfill_date)
    op.execute(""" COMMIT """)

Example 22

Project: cslbot Source File: 4d165186b4ed_fix_nullable.py
def downgrade():
    if op.get_bind().dialect.name == 'sqlite':
        with op.batch_alter_table('babble') as batch_op:
            batch_op.alter_column('word', existing_type=sa.TEXT(), nullable=False)
            batch_op.alter_column('target', existing_type=sa.TEXT(), nullable=False)
            batch_op.alter_column('source', existing_type=sa.TEXT(), nullable=False)
            batch_op.alter_column('key', existing_type=sa.VARCHAR(length=512), nullable=False)
    else:
        op.alter_column('babble', 'word', existing_type=sa.TEXT(), nullable=False)
        op.alter_column('babble', 'target', existing_type=sa.TEXT(), nullable=False)
        op.alter_column('babble', 'source', existing_type=sa.TEXT(), nullable=False)
        op.alter_column('babble', 'key', existing_type=sa.VARCHAR(length=512), nullable=False)

Example 23

Project: cslbot Source File: 385c29e42d9_remove_nicks.py
def downgrade():
    op.create_table(
        'nicks',
        sa.Column(
            'old', sa.TEXT(), autoincrement=False, nullable=True),
        sa.Column(
            'new', sa.TEXT(), autoincrement=False, nullable=True),
        sa.Column(
            'time', sa.INTEGER(), autoincrement=False, nullable=True),
        sa.Column(
            'id', sa.INTEGER(), nullable=False),
        sa.PrimaryKeyConstraint(
            'id', name='nicks_pkey'))

Example 24

Project: open-event-orga-server Source File: e702a5a988c2_.py
Function: upgrade
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('session', 'long_abstract',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('tracks', 'description',
               existing_type=sa.TEXT(),
               nullable=True)

Example 25

Project: rootio_web Source File: 3639bac661c0_link_person_to_netwo.py
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('radio_programtype', 'definition',
               existing_type=sa.TEXT(),
               type_=sa.TEXT(),
               existing_nullable=False)
    op.alter_column('radio_programtype', 'phone_functions',
               existing_type=sa.TEXT(),
               type_=sa.TEXT(),
               existing_nullable=False)

Example 26

Project: braindump Source File: c052ae5abc1d_remove_html_body_from_notes.py
Function: downgrade
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('notes', sa.Column('body_html', sa.TEXT(), autoincrement=False, nullable=True))

Example 27

Project: lastuser Source File: 2661b24d343f_clients_can_have_null_scope.py
Function: upgrade
def upgrade():
    op.alter_column('client', 'scope', existing_type=sa.TEXT(), nullable=True)
    op.execute(client.update().where(client.c.scope == '').values({'scope': None}))

Example 28

Project: socorro Source File: 144f7ace11e7_bug_822304_priority_.py
Function: downgrade
def downgrade():
    op.create_table(u'priority_jobs',
        sa.Column(u'uuid', sa.TEXT(), nullable=False)
    )

Example 29

Project: lastuser Source File: 2661b24d343f_clients_can_have_null_scope.py
Function: downgrade
def downgrade():
    op.alter_column('client', 'scope', existing_type=sa.TEXT(), nullable=False, server_default='')
    op.alter_column('client', 'scope', server_default=None)

Example 30

Project: hasjob Source File: 4f639a4a5fc3_apphash.py
Function: downgrade
def downgrade():
    op.alter_column('job_application', 'message',
               existing_type=sa.TEXT(),
               nullable=True)
    op.drop_column('job_application', 'hashid')

Example 31

Project: socorro Source File: 36abe253f8b3_fixes_902142_partiti.py
def upgrade():
    op.add_column(u'report_partition_info', sa.Column(u'partition_column', sa.TEXT()))

    # Drop FK constraints on parent tables
    op.drop_constraint('signature_summary_architecture_product_version_id_fkey', 'signature_summary_architecture')
    op.drop_constraint('signature_summary_architecture_signature_id_fkey', 'signature_summary_architecture')
    op.drop_constraint('signature_summary_flash_version_product_version_id_fkey', 'signature_summary_flash_version')
    op.drop_constraint('signature_summary_flash_version_signature_id_fkey', 'signature_summary_flash_version')
    op.drop_constraint('signature_summary_installations_signature_id_fkey', 'signature_summary_installations')
    op.drop_constraint('signature_summary_os_product_version_id_fkey', 'signature_summary_os')
    op.drop_constraint('signature_summary_os_signature_id_fkey', 'signature_summary_os')
    op.drop_constraint('signature_summary_process_type_product_version_id_fkey', 'signature_summary_process_type')
    op.drop_constraint('signature_summary_process_type_signature_id_fkey', 'signature_summary_process_type')
    op.drop_constraint('signature_summary_products_product_version_id_fkey', 'signature_summary_products')
    op.drop_constraint('signature_summary_products_signature_id_fkey', 'signature_summary_products')
    op.drop_constraint('signature_summary_uptime_product_version_id_fkey', 'signature_summary_uptime')
    op.drop_constraint('signature_summary_uptime_signature_id_fkey', 'signature_summary_uptime')

    app_path=os.getcwd()
    procs = ['weekly_report_partitions.sql',
             'backfill_weekly_report_partitions.sql']
    for myfile in [app_path + '/socorro/external/postgresql/raw_sql/procs/' + line for line in procs]:
        proc = open(myfile, 'r').read()
        op.execute(proc)
    # Now run this against the raw_crashes table
    op.execute("""
        UPDATE report_partition_info
        SET partition_column = 'date_processed'
    """)

    report_partition_info = table(u'report_partition_info',
        column(u'build_order', sa.INTEGER()),
        column(u'fkeys', postgresql.ARRAY(sa.TEXT())),
        column(u'indexes', postgresql.ARRAY(sa.TEXT())),
        column(u'keys', postgresql.ARRAY(sa.TEXT())),
        column(u'table_name', CITEXT()),
        column(u'partition_column', sa.TEXT()),
    )
    op.bulk_insert(report_partition_info, [
            {'table_name':  u'signature_summary_installations',
             'build_order': 5,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id,product_name,version_string,report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_architecture',
             'build_order': 6,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, architecture, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_flash_version',
             'build_order': 7,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, flash_version, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_os',
             'build_order': 8,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, os_version_string, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_process_type',
             'build_order': 9,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, process_type, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_products',
             'build_order': 10,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
            {'table_name':  u'signature_summary_uptime',
             'build_order': 11,
             'fkeys': ["(signature_id) REFERENCES signatures(signature_id)", "(product_version_id) REFERENCES product_versions(product_version_id)"],
             'partition_column': 'report_date',
             'keys': ["signature_id, uptime_string, product_version_id, report_date"],
             'indexes': ["report_date"],
            },
    ])

    op.alter_column(u'report_partition_info', u'partition_column',
               existing_type=sa.TEXT(),
               nullable=False)

    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_architecture')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_flash_version')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_installations')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_os')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_process_type')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_products')
    """)
    op.execute("""
        SELECT backfill_weekly_report_partitions('2013-06-03', '2013-08-12', 'signature_summary_uptime')
    """)

Example 32

Project: bodhi Source File: 37f38ddc4c8d_.py
def downgrade():
    op.alter_column('comments', 'text', existing_type=sa.TEXT(), nullable=True)

Example 33

Project: socorro Source File: 37004fc6e41e_bug_867606_add_data_.py
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(u'data_dictionary',
    sa.Column(u'raw_field', sa.TEXT(), nullable=False),
    sa.Column(u'transforms', JSON(), nullable=True),
    sa.Column(u'product', sa.TEXT(), nullable=True),
    sa.PrimaryKeyConstraint(u'raw_field')
    )

    data_dictionary_table = table(u'data_dictionary',
        column(u'raw_field', sa.TEXT()),
        column(u'transforms', JSON()),
        column(u'product', sa.TEXT())
    )
    op.bulk_insert(data_dictionary_table,
        [
            {"product": None, "transforms": "{}", "raw_field": "test"}
            , {"product": None, "transforms": "{\"data name\": \"AdapterDeviceID\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "AdapterDeviceID"}
            , {"product": None, "transforms": "{\"data name\": \"AdapterVendorID\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "AdapterVendorID"}
            , {"product": None, "transforms": "{\"data name\": \"Add-ons\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"addons\", \"ted's mdsw json\": \"extensions.extension_key, extensions.extension_id, extensions.extension_version \", \"1.X processed json\": \"\", \"processor transform\": \"addons\", \"collector:raw json\": \"\", \"processed json 2012\": \"list of lists \"}", "raw_field": "Add-ons"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Board\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Board"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Brand\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Brand"}
            , {"product": None, "transforms": "{\"data name\": \"Android_CPU_ABI2\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_CPU_ABI2"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Device\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Device"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Display\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Display"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Fingerprint\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Fingerprint"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Manufacturer\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Manufacturer"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Model\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Model"}
            , {"product": None, "transforms": "{\"data name\": \"Android_Version\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Android_Version"}
            , {"product": None, "transforms": "{\"data name\": \"AvailablePhysicalMemory\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "AvailablePhysicalMemory"}
            , {"product": None, "transforms": "{\"data name\": \"AvailableVirtualMemory\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "AvailableVirtualMemory"}
            , {"product": None, "transforms": "{\"data name\": \"AvalablePageFile\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "AvalablePageFile"}
            , {"product": None, "transforms": "{\"data name\": \"BuildID\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"build\", \"ted's mdsw json\": \"reports.build (16)\", \"1.X processed json\": \"\", \"processor transform\": \"build\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "BuildID"}
            , {"product": None, "transforms": "{\"data name\": \"buildid\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"inadvertent extra value from breakpad, not used\"}", "raw_field": "buildid"}
            , {"product": None, "transforms": "{\"data name\": \"Comments\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 500 characters; None if missing\", \"pj transform\": \"user_comments\", \"ted's mdsw json\": \"reports.user_comments (500)\", \"1.X processed json\": \"truncated to 500 characters; None if missing\", \"processor transform\": \"user_comments\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Comments"}
            , {"product": None, "transforms": "{\"data name\": \"CrashTime\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 10 characters, converted to integer; if missing, reverts to the value of 'timestamp'.  Converted to timestamp with time zone in the database\\n\", \"pj transform\": \"client_crash_date\", \"ted's mdsw json\": \"reports.client_crash_date\", \"1.X processed json\": \"truncated to 10 characters, converted to integer; if missing, reverts to the value of 'timestamp'.  Converted back to string in almost ISO 8601 for json.\\n\", \"processor transform\": \"client_crash_date\", \"collector:raw json\": \"\", \"processed json 2012\": \"UTZ applied by processor\"}", "raw_field": "CrashTime"}
            , {"product": None, "transforms": "{\"data name\": \"submitted_timestamp\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"reports.date_processed\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "submitted_timestamp"}
            , {"product": None, "transforms": "{\"data name\": \"Distributor\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 20 characters; None if missing\", \"pj transform\": \"distributor\", \"ted's mdsw json\": \"reports.distributor (20)\", \"1.X processed json\": \"truncated to 20 characters; None if missing\", \"processor transform\": \"distributor\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Distributor"}
            , {"product": None, "transforms": "{\"data name\": \"Distributor_version\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 20 characters; None if missing\", \"pj transform\": \"distributor_version\", \"ted's mdsw json\": \"reports.distributor_version (20)\", \"1.X processed json\": \"truncated to 20 characters; None if missing\", \"processor transform\": \"distributor_version\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Distributor_version"}
            , {"product": None, "transforms": "{\"data name\": \"Email\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 100 characters; None if missing\", \"pj transform\": \"\", \"ted's mdsw json\": \"reports.email (100)\", \"1.X processed json\": \"truncated to 100 characters; None if missing\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Email"}
            , {"product": None, "transforms": "{\"data name\": \"EMCheckCompatibility\", \"mdsw pipe dump\": \"\", \"database\": \"converted to lower case, then to boolean True if 'true' and False for any other value\", \"pj transform\": \"addons_checked\", \"ted's mdsw json\": \"reports.addons_checked\", \"1.X processed json\": \"converted to lower case, then to boolean True if 'true' and False for any other value\", \"processor transform\": \"addons_checked\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "EMCheckCompatibility"}
            , {"product": None, "transforms": "{\"data name\": \"FramePoisonBase\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "FramePoisonBase"}
            , {"product": None, "transforms": "{\"data name\": \"FramePoisonSize\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "FramePoisonSize"}
            , {"product": None, "transforms": "{\"data name\": \"Hang\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"not currently enabled in breakpad\"}", "raw_field": "Hang"}
            , {"product": None, "transforms": "{\"data name\": \"HangID\", \"mdsw pipe dump\": \"\", \"database\": \"no conversion; None if missng\", \"pj transform\": \"hangid\", \"ted's mdsw json\": \"reports.hangid\", \"1.X processed json\": \"no conversion; None if missng\", \"processor transform\": \"hangid\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "HangID"}
            , {"product": None, "transforms": "{\"data name\": \"id\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"name collision: the raw json 'id'\"}", "raw_field": "id"}
            , {"product": None, "transforms": "{\"data name\": \"InstallTime\", \"mdsw pipe dump\": \"\", \"database\": \"converted to int; reverts to 'startuptime' if missing\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"converted to int; reverts to 'startuptime' if missing\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "InstallTime"}
            , {"product": None, "transforms": "{\"data name\": \"JavaStackTrace\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"java_stack_trace\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "JavaStackTrace"}
            , {"product": None, "transforms": "{\"data name\": \"legacy_processing\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"added by collector\"}", "raw_field": "legacy_processing"}
            , {"product": None, "transforms": "{\"data name\": \"Min_ARM_Version\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Min_ARM_Version"}
            , {"product": None, "transforms": "{\"data name\": \"Notes\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 1000; None if missing\", \"pj transform\": \"app_notes\", \"ted's mdsw json\": \"reports.app_notes (1000)\", \"1.X processed json\": \"truncated to 1000; None if missing\", \"processor transform\": \"app_notes\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Notes"}
            , {"product": None, "transforms": "{\"data name\": \"PluginFilename\", \"mdsw pipe dump\": \"\", \"database\": \"no conversion; empty string if missing\", \"pj transform\": \"pluginFilename\", \"ted's mdsw json\": \"plugins.filename\", \"1.X processed json\": \"only present if 'plugin' crash type\", \"processor transform\": \"pluginFilename\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "PluginFilename"}
            , {"product": None, "transforms": "{\"data name\": \"PluginName\", \"mdsw pipe dump\": \"\", \"database\": \"no conversion; empty string if missing\", \"pj transform\": \"pluginName\", \"ted's mdsw json\": \"plugins.name\", \"1.X processed json\": \"only present if 'plugin' crash type\", \"processor transform\": \"pluginName\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "PluginName"}
            , {"product": None, "transforms": "{\"data name\": \"PluginVersion\", \"mdsw pipe dump\": \"\", \"database\": \"no conversion; empty string if missing\", \"pj transform\": \"pluginVersion\", \"ted's mdsw json\": \"plugins_reports.pluginVersion\", \"1.X processed json\": \"only present if 'plugin' crash type\", \"processor transform\": \"pluginVersion\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "PluginVersion"}
            , {"product": None, "transforms": "{\"data name\": \"ProcessType\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 10; None if missing\", \"pj transform\": \"process_type\", \"ted's mdsw json\": \"reports.process_type\", \"1.X processed json\": \"truncated to 10; None if missing\", \"processor transform\": \"process_type\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "ProcessType"}
            , {"product": None, "transforms": "{\"data name\": \"ProductName\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"product\", \"ted's mdsw json\": \"reports.product (30)\", \"1.X processed json\": \"\", \"processor transform\": \"product\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "ProductName"}
            , {"product": None, "transforms": "{\"data name\": \"ReleaseChannel\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"release_channel\", \"ted's mdsw json\": \"reports.release_channel\", \"1.X processed json\": \"\", \"processor transform\": \"release_channel\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "ReleaseChannel"}
            , {"product": None, "transforms": "{\"data name\": \"SecondsSinceLastCrash\", \"mdsw pipe dump\": \"\", \"database\": \"converted to int\", \"pj transform\": \"last_crash\", \"ted's mdsw json\": \"reports.last_crash\", \"1.X processed json\": \"converted to int\", \"processor transform\": \"last_crash\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "SecondsSinceLastCrash"}
            , {"product": None, "transforms": "{\"data name\": \"StartupTime\", \"mdsw pipe dump\": \"\", \"database\": \"converted to int; reverts to 'CrashTime' if missing\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"converted to int; reverts to 'CrashTime' if missing\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"decimal unix timestamp of 10 or fewer digits\"}", "raw_field": "StartupTime"}
            , {"product": None, "transforms": "{\"data name\": \"SystemMemoryUsePercentage\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "SystemMemoryUsePercentage"}
            , {"product": None, "transforms": "{\"data name\": \"Theme\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Theme"}
            , {"product": None, "transforms": "{\"data name\": \"Throttleable\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Throttleable"}
            , {"product": None, "transforms": "{\"data name\": \"timestamp\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "timestamp"}
            , {"product": None, "transforms": "{\"data name\": \"TotalVirtualMemory\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "TotalVirtualMemory"}
            , {"product": None, "transforms": "{\"data name\": \"URL\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 255; None if missing\", \"pj transform\": \"\", \"ted's mdsw json\": \"reports.url (255)\", \"1.X processed json\": \"truncated to 255; None if missing\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "URL"}
            , {"product": None, "transforms": "{\"data name\": \"UserID\", \"mdsw pipe dump\": \"\", \"database\": \"forced to empty string\", \"pj transform\": \"\", \"ted's mdsw json\": \"reports.user_id\", \"1.X processed json\": \"forced to empty string\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"processor always leaves this blank\"}", "raw_field": "UserID"}
            , {"product": None, "transforms": "{\"data name\": \"Vendor\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Vendor"}
            , {"product": None, "transforms": "{\"data name\": \"Version\", \"mdsw pipe dump\": \"\", \"database\": \"truncated to 16; 'esr' appended if ReleaseChannel is 'ESR'; None if missing\", \"pj transform\": \"version\", \"ted's mdsw json\": \"reports.version (16)\", \"1.X processed json\": \"truncated to 16; 'esr' appended if ReleaseChannel is 'ESR'; None if missing\", \"processor transform\": \"version\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Version"}
            , {"product": None, "transforms": "{\"data name\": \"version\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"\", \"collector:raw json\": \"\", \"processed json 2012\": \"inadvertent extra value from breakpad, not used\"}", "raw_field": "version"}
            , {"product": None, "transforms": "{\"data name\": \"Winsock_LSP\", \"mdsw pipe dump\": \"\", \"database\": \"\", \"pj transform\": \"Winsock_LSP\", \"ted's mdsw json\": \"\", \"1.X processed json\": \"\", \"processor transform\": \"Winsock_LSP\", \"collector:raw json\": \"\", \"processed json 2012\": \"\"}", "raw_field": "Winsock_LSP"}
    ])

Example 34

Project: socorro Source File: 4bb277899d74_add_version_build_co.py
Function: upgrade
def upgrade():
    op.add_column(u'product_versions', sa.Column(u'version_build', sa.TEXT(), nullable=True))
    op.add_column(u'releases_raw', sa.Column(u'version_build', sa.TEXT(), nullable=True))

Example 35

Project: socorro Source File: 35604f61bc24_bug_902839_add_versi.py
def upgrade():
    op.add_column(u'signature_summary_architecture', sa.Column(u'version_string', sa.TEXT()))
    op.add_column(u'signature_summary_flash_version', sa.Column(u'version_string', sa.TEXT()))
    op.add_column(u'signature_summary_os', sa.Column(u'version_string', sa.TEXT()))
    op.add_column(u'signature_summary_process_type', sa.Column(u'version_string', sa.TEXT()))
    op.add_column(u'signature_summary_uptime', sa.Column(u'version_string', sa.TEXT()))
    op.execute("""
        UPDATE signature_summary_architecture
            SET version_string = product_versions.version_string
        FROM product_versions
        WHERE product_versions.product_version_id = signature_summary_architecture.product_version_id
    """)
    op.execute("""
        UPDATE signature_summary_flash_version
            SET version_string = product_versions.version_string
        FROM product_versions
        WHERE product_versions.product_version_id = signature_summary_flash_version.product_version_id
    """)
    op.execute("""
        UPDATE signature_summary_os
            SET version_string = product_versions.version_string
        FROM product_versions
        WHERE product_versions.product_version_id = signature_summary_os.product_version_id
    """)
    op.execute("""
        UPDATE signature_summary_process_type
            SET version_string = product_versions.version_string
        FROM product_versions
        WHERE product_versions.product_version_id = signature_summary_process_type.product_version_id
    """)
    op.execute("""
        UPDATE signature_summary_uptime
            SET version_string = product_versions.version_string
        FROM product_versions
        WHERE product_versions.product_version_id = signature_summary_uptime.product_version_id
    """)
    op.alter_column(u'signature_summary_architecture', u'version_string', nullable=False)
    op.alter_column(u'signature_summary_flash_version', u'version_string', nullable=False)
    op.alter_column(u'signature_summary_os', u'version_string', nullable=False)
    op.alter_column(u'signature_summary_process_type', u'version_string', nullable=False)
    op.alter_column(u'signature_summary_uptime', u'version_string', nullable=False)
    app_path=os.getcwd()
    procs = [
        'update_signature_summary.sql'
    ]
    for myfile in [app_path + '/socorro/external/postgresql/raw_sql/procs/' + line for line in procs]:
        with open(myfile, 'r') as file:
            op.execute(file.read())

Example 36

Project: socorro Source File: 4c7a28212f15_crontabber.py
def upgrade():
    op.create_table(
        u'crontabber',
        sa.Column(u'app_name', sa.TEXT(), nullable=False),
        sa.Column(u'next_run', sa.TIMESTAMP(timezone=True)),
        sa.Column(u'first_run', sa.TIMESTAMP(timezone=True)),
        sa.Column(u'last_run', sa.TIMESTAMP(timezone=True)),
        sa.Column(u'last_success', sa.TIMESTAMP(timezone=True)),
        sa.Column(u'error_count', sa.INTEGER(), nullable=False,
                  server_default='0'),
        sa.Column(u'depends_on', postgresql.ARRAY(sa.TEXT())),
        sa.Column(u'last_error', jsontype.JsonType()),
        sa.PrimaryKeyConstraint(u'app_name')
    )
    op.create_index('crontabber_app_name_idx', 'crontabber', ['app_name'])

    op.create_table(
        u'crontabber_log',
        sa.Column(u'id', sa.INTEGER(), nullable=False),
        sa.Column(u'app_name', sa.TEXT(), nullable=False),
        sa.Column(u'log_time', sa.TIMESTAMP(timezone=True), nullable=False,
                  server_default=sa.text('NOW()')),
        sa.Column(u'success', sa.TIMESTAMP(timezone=True)),
        sa.Column(u'exc_type', sa.TEXT()),
        sa.Column(u'exc_value', sa.TEXT()),
        sa.Column(u'exc_traceback', sa.TEXT()),
        sa.PrimaryKeyConstraint(u'id')
    )
    op.create_index('crontabber_log_app_name_idx',
                    'crontabber_log', ['app_name'])
    op.create_index('crontabber_log_log_time_idx',
                    'crontabber_log', ['log_time'])

Example 37

Project: data-act-broker-backend Source File: c2b6d88e6d44_removing_url_from_d_file_metadata.py
Function: downgrade_data_broker
def downgrade_data_broker():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('d_file_metadata', sa.Column('url', sa.TEXT(), autoincrement=False, nullable=True))

Example 38

Project: Mycodo Source File: 24f75895d28e_add_camera_record_option_to_sensor_.py
def upgrade():
    with op.batch_alter_table("sensorconditional") as batch_op:
        batch_op.add_column(sa.Column('camera_record', sa.TEXT))

Example 39

Project: socorro Source File: 4d8345089e2a_fixes_bug_968493_add.py
def upgrade():
    op.create_table(u'raw_update_channels',
        sa.Column(u'update_channel', sa.TEXT(), nullable=False),
        sa.Column(u'product_name', sa.TEXT(), nullable=False),
        sa.Column(u'version', sa.TEXT(), nullable=False),
        sa.Column(u'build', sa.NUMERIC(), nullable=False),
        sa.Column(u'first_report', postgresql.TIMESTAMP(timezone=True), nullable=False),
        sa.PrimaryKeyConstraint(u'update_channel', u'product_name', u'version', u'build')
    )
    fix_permissions(op, 'raw_update_channels')

    op.create_table(u'update_channel_map',
        sa.Column(u'update_channel', sa.TEXT(), nullable=False),
        sa.Column(u'productid', sa.TEXT(), nullable=False),
        sa.Column(u'version_field', sa.TEXT(), nullable=False),
        sa.Column(u'rewrite', jsontype.JsonType(), nullable=False),
        sa.PrimaryKeyConstraint(u'update_channel', u'productid', u'version_field')
    )
    fix_permissions(op, 'update_channel_map')

    op.execute("""
        INSERT INTO update_channel_map
        (update_channel, productid, version_field, rewrite)
        VALUES
        ('nightly',
         '{3c2e2abc-06d4-11e1-ac3b-374f68613e61}',
         'B2G_OS_Version',
         '{"Android_Manufacturer": "ZTE",
           "Android_Model": "roamer2",
           "Android_Version": "15(REL)",
           "B2G_OS_Version": "1.0.1.0-prerelease",
           "BuildID":
                ["20130621133927", "20130621152332",
                 "20130531232151", "20130617105829",
                 "20130724040538"],
            "ProductName": "B2G",
            "ReleaseChannel": "nightly",
            "Version": "18.0",
            "rewrite_to": "release-zte"}'
        )
    """)

    # nothing depends on this yet in stored procs
    op.add_column(u'reports_clean', sa.Column(u'update_channel', sa.TEXT(), nullable=True))

    load_stored_proc(op, ['update_raw_update_channel.sql',
                          'backfill_raw_update_channel.sql',
                          'backfill_matviews.sql'])

Example 40

Project: Mycodo Source File: 22bd961f2c91_remove_redundant_adc_address_from_.py
def downgrade():
    with op.batch_alter_table("sensor") as batch_op:
        batch_op.add_column(sa.Column('adc_address', sa.TEXT))

Example 41

Project: socorro Source File: 4de11772649b_bug905346_fix_timezo.py
Function: upgrade
def upgrade():
    op.add_column(u'report_partition_info', sa.Column(u'timetype', sa.TEXT()))
    op.execute("""
        UPDATE report_partition_info SET timetype = 'TIMESTAMPTZ'
            where partition_column = 'date_processed'
    """)
    op.execute("""
        UPDATE report_partition_info SET timetype = 'DATE'
            where partition_column = 'report_date'
    """)
    op.alter_column(u'report_partition_info', u'timetype', nullable=False)

    op.execute("""
        DROP FUNCTION IF EXISTS create_weekly_partition(citext, date, text, text, text[], text[], text[], boolean)
    """)

    app_path=os.getcwd()
    procs = [
              'create_weekly_partition.sql'
            , 'weekly_report_partitions.sql'
            ]
    for myfile in [app_path + '/socorro/external/postgresql/raw_sql/procs/' + line for line in procs]:
        proc = open(myfile, 'r').read()
        op.execute(proc)

Example 42

Project: Mycodo Source File: 4c8aab824d21_add_column_timer_to_table_displayorder.py
def upgrade():
    with op.batch_alter_table("displayorder") as batch_op:
        batch_op.add_column(sa.Column('timer', sa.TEXT))

Example 43

Project: Mycodo Source File: 52aeaa701dfb_rename_and_add_timer_column.py
def upgrade():
    with op.batch_alter_table("timer") as batch_op:
        batch_op.add_column(sa.Column('time_end', sa.TEXT))
        batch_op.add_column(sa.Column('timer_type', sa.TEXT))
        batch_op.alter_column("time_on", new_column_name="time_start")

    op.execute(
        '''
        UPDATE timer
        SET timer_type='duration'
        WHERE time_start IS ''
        '''
    )

    op.execute(
        '''
        UPDATE timer
        SET timer_type='time'
        WHERE time_start IS NOT ''
        '''
    )

Example 44

Project: Mycodo Source File: 7a3ae1ec200d_add_more_switch_parameters.py
def upgrade():
    with op.batch_alter_table("sensor") as batch_op:
        batch_op.add_column(sa.Column('switch_edge', sa.TEXT))
        batch_op.add_column(sa.Column('switch_bouncetime', sa.INT))

Example 45

Project: Mycodo Source File: 25b4c7b9969e_add_gpio_state_monitoring_to_sensor_.py
def upgrade():
    with op.batch_alter_table("sensorconditional") as batch_op:
        batch_op.add_column(sa.Column('edge_select', sa.TEXT))
        batch_op.add_column(sa.Column('gpio_state', sa.INT))

Example 46

Project: Mycodo Source File: 96d3834825f9_add_table_method_for_new_setpoint_.py
Function: upgrade
def upgrade():
    op.create_table(
        'method',
        sa.Column('id', sa.TEXT, unique=True, primary_key=True, nullable=False),
        sa.Column('name', sa.TEXT),
        sa.Column('method_id', sa.TEXT),
        sa.Column('method_type', sa.TEXT),
        sa.Column('method_order', sa.INT),
        sa.Column('start_time', sa.TEXT),
        sa.Column('end_time', sa.TEXT),
        sa.Column('duration_sec', sa.INT),
        sa.Column('relay_id', sa.TEXT),
        sa.Column('relay_state', sa.TEXT),
        sa.Column('relay_duration', sa.REAL),
        sa.Column('start_setpoint', sa.REAL),
        sa.Column('end_setpoint', sa.REAL)
    )

    with op.batch_alter_table("pid") as batch_op:
        batch_op.add_column(sa.Column('method_id', sa.TEXT))

    op.execute(
        '''
        UPDATE pid
        SET method_id=''
        WHERE method_id IS NULL
        '''
    )

Example 47

Project: piecash Source File: test_model_common.py
    def test_addr_composite(self):
        flds = "name addr1 addr2 addr3 addr4 email fax phone".split()

        class B(DeclarativeBaseGuid):
            __tablename__ = "b_table"

            def __init__(self, **kwargs):
                for k, v in kwargs.items():
                    setattr(self, k, v)

        l = []
        for fld in flds:
            col = Column(fld, TEXT())
            setattr(B, fld, col)
            l.append(col)
        B.addr = composite(Address, *l)

        s = session()
        a = B(addr1="foo")
        assert a.addr
        a.addr.fax = "baz"
        assert a.addr1 == "foo"
        assert a.addr.addr1 == "foo"
        assert a.addr.fax == "baz"
        s.add(a)
        s.flush()

Example 48

Project: changes Source File: 48a922151dd4_correct_test_schemas.py
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('testsuite', 'name',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('testsuite', 'date_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('testgroup', 'result',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('testgroup', 'num_tests',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('testgroup', 'num_failed',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('testgroup', 'name',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('testgroup', 'date_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)
    op.alter_column('test', 'result',
               existing_type=sa.INTEGER(),
               nullable=True)
    op.alter_column('test', 'date_created',
               existing_type=postgresql.TIMESTAMP(),
               nullable=True)

Example 49

Project: funnel Source File: a2115fab4c4_proposal_fields_are_now_optional.py
Function: upgrade
def upgrade():
    op.alter_column('proposal', 'description_html',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'description_text',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'links',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'objective_html',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'objective_text',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'preview_video',
               existing_type=sa.VARCHAR(length=250),
               nullable=True)
    op.alter_column('proposal', 'requirements_html',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'requirements_text',
               existing_type=sa.TEXT(),
               nullable=True)
    op.alter_column('proposal', 'session_type',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)
    op.alter_column('proposal', 'slides',
               existing_type=sa.VARCHAR(length=250),
               nullable=True)
    op.alter_column('proposal', 'technical_level',
               existing_type=sa.VARCHAR(length=40),
               nullable=True)

Example 50

Project: Mycodo Source File: d549de374d71_add_edge_detection_to_sensor_.py
def upgrade():
    with op.batch_alter_table("sensorconditional") as batch_op:
        batch_op.add_column(sa.Column('edge_detected', sa.TEXT))
See More Examples - Go to Next Page
Page 1 Selected Page 2