def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_constraint(None, 'TOUR_IMAGE', type_='unique') op.create_table( 'TOUR_LOCATION', sa.Column('id', sa.INTEGER(), server_default=sa.text( 'nextval(\'"TOUR_LOCATION_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('tour_id', postgresql.UUID(), autoincrement=False, nullable=False), sa.Column('name', sa.VARCHAR(length=60), autoincrement=False, nullable=True), sa.Column('address', sa.VARCHAR(length=60), autoincrement=False, nullable=True), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('lng', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['tour_id'], ['TOUR.uuid'], name='TOUR_LOCATION_tour_id_fkey'), sa.PrimaryKeyConstraint('id', name='TOUR_LOCATION_pkey')) op.drop_table('LOCATION')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('pokemonTeamBuilderTest', sa.Column('id', sa.INTEGER(), server_default=sa.text(u'nextval(\'"pokemonTeamBuilderTest_id_seq"\'::regclass)'), nullable=False), sa.Column('num_dex', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('species', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('forme', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('type1', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('type2', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('ability1', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('ability2', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('abilityH', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('hp', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('attack', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('defense', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('spattack', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('spdefense', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('speed', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('total', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('weight', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('height', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('dex1', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('dex2', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('pkmn_class', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('percent_male', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('percent_female', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('pre_evolution', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('egg_group1', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('egg_group2', sa.VARCHAR(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name=u'pokemonTeamBuilderTest_pkey') ) op.drop_table('pokemon')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('emails', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('value', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('week', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('company_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['company_id'], ['companies.id'], name='emails_company_id_fkey'), sa.PrimaryKeyConstraint('id', name='emails_pkey') ) op.create_table('customers', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('value', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('week', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('company_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['company_id'], ['companies.id'], name='customers_company_id_fkey'), sa.PrimaryKeyConstraint('id', name='customers_pkey') ) op.drop_table('subscribers') op.drop_table('product_releases') op.drop_table('preorders') op.drop_table('pilots') op.drop_table('paying_users') op.drop_table('other_2') op.drop_table('other_1') op.drop_table('mrr') op.drop_table('marketing_spent') op.drop_table('engagement') op.drop_table('cpa') op.drop_table('conversion_rate') op.drop_table('automation_percents') op.drop_table('active_users')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'veiwPoint', sa.Column('ID', sa.INTEGER(), server_default=sa.text( 'nextval(\'"veiwPoint_ID_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('long', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('ID', name='veiwPoint_pkey')) op.create_index('ix_veiwPoint_ID', 'veiwPoint', ['ID'], unique=False) op.drop_index(op.f('ix_VeiwPoint_ID'), table_name='VeiwPoint') op.drop_table('VeiwPoint')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('charge_measurement', 'timestamp', existing_type=postgresql.TIMESTAMP(), nullable=True) op.alter_column('charge_measurement', 'charge_id', existing_type=sa.INTEGER(), nullable=True) op.add_column( 'charge', sa.Column('charge_tape', postgresql.ENUM('charging', 'discharging', 'maintenance', name='chargestateenum'), autoincrement=False, nullable=True)) op.alter_column('charge', 'start_voltage', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('charge', 'start_date', existing_type=postgresql.TIMESTAMP(), nullable=True) op.alter_column('charge', 'battery_id', existing_type=sa.INTEGER(), nullable=True) op.drop_column('charge', 'charge_type') op.alter_column('battery', 'no_of_cells', existing_type=sa.INTEGER(), nullable=True) op.alter_column('battery', 'min_voltage', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('battery', 'maintenance_voltage', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('battery', 'is_active', existing_type=sa.BOOLEAN(), nullable=True) op.alter_column('battery', 'full_charge_voltage', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('battery', 'discharge_rate', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('battery', 'capacity', existing_type=sa.INTEGER(), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'store', sa.Column('location_id', sa.INTEGER(), autoincrement=False, nullable=True)) op.create_foreign_key('store_location_id_fkey', 'store', 'location', ['location_id'], ['location_id'], onupdate='CASCADE', ondelete='RESTRICT') op.drop_column('store', 'place_id') op.drop_column('store', 'address') op.create_foreign_key('appuser_home_fkey', 'appuser', 'location', ['home'], ['location_id'], onupdate='CASCADE', ondelete='RESTRICT') op.create_table( 'location', sa.Column('location_id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('long', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('location_id', name='location_pkey'))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'area2', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(length=250), autoincrement=False, nullable=False), sa.Column('lon', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='area2_pkey')) op.create_table( 'area', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(length=250), autoincrement=False, nullable=False), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('lon', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='area_pkey')) op.drop_table('area', schema='agro_data')
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'category', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('title', sa.VARCHAR(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='category_pkey')) op.create_table( 'dish', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('title', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('price', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('description', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('picture', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('category_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='dish_pkey'), sa.ForeignKeyConstraint(['category_id'], ['category.id'], name='dish_category_id_fkey'), ) op.create_table( 'user', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('mail', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('password', sa.VARCHAR(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='user_pkey')) op.create_table( 'order', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('date', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('price', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('status_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('mail', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('address', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('dishes', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='order_pkey'), sa.ForeignKeyConstraint(['user_id'], ['user.id'], name='order_user_id_fkey'), )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'submission', sa.Column('geopoint', postgresql.JSONB(astext_type=sa.Text()), autoincrement=False, nullable=True)) op.execute( "UPDATE submission SET geopoint = json_build_object('lon', ST_X(submission.geom), 'lat', ST_Y(submission.geom))" ) op.drop_column('submission', 'geom') op.add_column( 'location', sa.Column('lon', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'location', sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.execute( 'UPDATE location SET lon = ST_X(location.geom), lat = ST_Y(location.geom)' ) op.drop_column('location', 'geom') op.execute('DROP EXTENSION IF EXISTS postgis')
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('address', 'latitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('address', 'longitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.create_index(op.f('ix_address_latitude'), 'address', ['latitude'], unique=False) op.create_index(op.f('ix_address_longitude'), 'address', ['longitude'], unique=False) op.alter_column('stop', 'latitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('stop', 'longitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.create_index(op.f('ix_stop_latitude'), 'stop', ['latitude'], unique=False) op.create_index(op.f('ix_stop_longitude'), 'stop', ['longitude'], unique=False)
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column( 'activities', sa.Column('hr_score', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'activities', sa.Column('step_score', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'activities', sa.Column('outlier_tag', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column( 'activities', sa.Column('sleep_score', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_column('PROLIFIC_TASK', 'title') op.create_table( 'Reward', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Reward_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('w_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('points_earned', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('total_bonus', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('total_reward', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['w_id'], ['Worker.id'], name='Reward_w_id_fkey'), sa.PrimaryKeyConstraint('id', name='Reward_pkey'))
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column( 'hail', sa.Column('client_id', sa.INTEGER(), autoincrement=False, nullable=False)) op.add_column( 'hail', sa.Column('client_lon', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False)) op.add_column( 'hail', sa.Column('client_lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False)) op.drop_column('hail', 'operateur_id') op.drop_column('hail', 'customer_lon') op.drop_column('hail', 'customer_lat') op.drop_column('hail', 'customer_id') op.drop_table('customer')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'stat', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('timestamp', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('stat_db_size', sa.BIGINT(), server_default=sa.text("'0'::bigint"), autoincrement=False, nullable=True), sa.Column('stat_num_new_sessions', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True), sa.Column('stat_system_load_avg', postgresql.DOUBLE_PRECISION(precision=53), server_default=sa.text("'0'::double precision"), autoincrement=False, nullable=True), sa.Column('stat_num_redis_keys', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True), sa.Column('stat_redis_memory_usage', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='stat_pkey'))
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'order_items', sa.Column('id', sa.Integer(), autoincrement=True, nullable=False), sa.Column('quantity', sa.Integer(), nullable=False), sa.Column('price', sa.Float(), nullable=True), sa.Column('basket_id', sa.Integer(), nullable=False), sa.Column('order_id', sa.Integer(), nullable=False), sa.ForeignKeyConstraint( ['basket_id'], ['basket.id'], ), sa.ForeignKeyConstraint( ['order_id'], ['orders.id'], ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('id')) op.add_column('basket', sa.Column('price', sa.Float(), nullable=True)) op.alter_column('basket', 'weight', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('orders', 'price', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'odds', sa.Column('date_time', postgresql.TIMESTAMP(), autoincrement=False, nullable=False)) op.add_column( 'odds', sa.Column('value', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False)) op.alter_column('odds', 'win', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('odds', 'place', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('odds', 'checkpoint_id', existing_type=sa.INTEGER(), nullable=True)
def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column('watches', sa.Column('fragment', sa.Integer(), nullable=True)) connection = op.get_bind() for row in connection.execute(watchesshelper.select()): if row.chapter: frag = int(row.chapter * 100) % 100 if frag: connection.execute(watchesshelper.update().where( watchesshelper.c.id == row.id).values(chapter=int( row.chapter), fragment=frag)) op.alter_column('watches', 'chapter', existing_type=postgresql.DOUBLE_PRECISION(precision=53), type_=sa.Integer(), existing_nullable=True) op.alter_column('watches', 'volume', existing_type=postgresql.DOUBLE_PRECISION(precision=53), type_=sa.Integer(), existing_nullable=True)
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column( 'users', sa.Column('house_id', sa.INTEGER(), autoincrement=False, nullable=True)) op.create_foreign_key('users_house_id_fkey', 'users', 'house', ['house_id'], ['id'], ondelete='SET NULL') op.create_table( 'house', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('owner', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('latitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('longitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['owner'], ['users.id'], name='house_owner_fkey'), sa.PrimaryKeyConstraint('id', name='house_pkey')) op.drop_table('relationships')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'request', sa.Column( 'request_id', sa.INTEGER(), server_default=sa.text( u'nextval(\'"bb-case-tracking_request_id_seq"\'::regclass)'), nullable=False), sa.Column('case_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('device_id', sa.TEXT(), autoincrement=False, nullable=True), sa.Column('longitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('latitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('timestamp', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['case_id'], [u'case.case_id'], name=u'bb-case-tracking_case_id_fkey'), sa.PrimaryKeyConstraint('request_id', name=u'bb-case-tracking_pkey')) op.drop_table('bb-case-tracking')
def downgrade(): op.alter_column('actions', 'user_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('actions', 'rp_longitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('actions', 'rp_latitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('actions', 'ipp_longitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('actions', 'ipp_latitude', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('actions', 'action_status_id', existing_type=sa.INTEGER(), nullable=False) op.drop_column('actions', 'deleted') op.drop_column('actions', 'archived')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( "zipcodes", sa.Column( "num_sensors", sa.INTEGER(), server_default=sa.text("0"), autoincrement=False, nullable=False, ), ) op.add_column( "zipcodes", sa.Column( "max_sensor_distance", postgresql.DOUBLE_PRECISION(precision=53), server_default=sa.text("'0'::double precision"), autoincrement=False, nullable=False, ), ) op.add_column( "zipcodes", sa.Column( "min_sensor_distance", postgresql.DOUBLE_PRECISION(precision=53), server_default=sa.text("'0'::double precision"), autoincrement=False, nullable=False, ), )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('tissue_network_gene', sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False), sa.Column('gene', sa.VARCHAR(length=32), autoincrement=False, nullable=True), sa.Column('contrast_gene', sa.VARCHAR(length=32), autoincrement=False, nullable=True), sa.Column('weight', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('tissue', sa.VARCHAR(length=32), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='tissue_network_gene_pkey') ) op.create_table('gene_network_gene', sa.Column('id', postgresql.UUID(), autoincrement=False, nullable=False), sa.Column('gene', sa.VARCHAR(length=32), autoincrement=False, nullable=True), sa.Column('contrast_gene', sa.VARCHAR(length=32), autoincrement=False, nullable=True), sa.Column('weight', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('disease', sa.VARCHAR(length=64), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='gene_network_gene_pkey') ) op.drop_table('retinoblastoma') op.drop_table('retina_non_macula') op.drop_table('retina_macula') op.drop_table('retina') op.drop_table('non_macula') op.drop_table('macula') op.drop_table('keratoconus') op.drop_table('corneal_endothelial_cells') op.drop_table('corneal') op.drop_table('age_related_macular_degeneration')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('shift_signup', schema=None) as batch_op: batch_op.alter_column('duration', existing_type=sa.Integer(), type_=postgresql.DOUBLE_PRECISION(precision=53), existing_nullable=True) with op.batch_alter_table('shift', schema=None) as batch_op: batch_op.alter_column('duration', existing_type=sa.Integer(), type_=postgresql.DOUBLE_PRECISION(precision=53), existing_nullable=True) with op.batch_alter_table('schedule_event', schema=None) as batch_op: batch_op.alter_column('duration', existing_type=sa.Integer(), type_=postgresql.DOUBLE_PRECISION(precision=53), existing_nullable=True) with op.batch_alter_table('email_trigger', schema=None) as batch_op: batch_op.alter_column('context', existing_type=sa.JSON(), type_=sa.VARCHAR(length=4096), existing_nullable=True) with op.batch_alter_table('background_job', schema=None) as batch_op: batch_op.alter_column('result', existing_type=sa.LargeBinary(), type_=postgresql.JSON(astext_type=sa.Text()), existing_nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'bike', sa.Column('slick_front_pressure', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'bike', sa.Column('rain_rear_pressure', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'bike', sa.Column('rain_front_pressure', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'bike', sa.Column('slick_rear_pressure', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('topping', sa.Column('pizza_id', sa.INTEGER(), autoincrement=False, nullable=True)) op.create_foreign_key('topping_pizza_id_fkey', 'topping', 'pizza', ['pizza_id'], ['id']) op.add_column('steaktopping', sa.Column('small_price', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('steaktopping', sa.Column('steak_id', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('steaktopping', sa.Column('large_price', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.create_foreign_key('steaktopping_steak_id_fkey', 'steaktopping', 'sub', ['steak_id'], ['id'])
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('stations', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('lat', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('lng', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='stations_pkey') )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('planet', sa.Column('day_length', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('planet', sa.Column('year_length', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('planet', sa.Column('size', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.drop_column('planet', 'year_length_in_earth_days') op.drop_column('planet', 'size_in_miles') op.drop_column('planet', 'day_length_in_hours')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('batters', sa.Column('BB', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('HR', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('obp', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('CS', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('avg', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('K', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('Double', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('Triple', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('PA', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('HBP', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('RBI', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('Hit', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('ops', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('SB', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('slg', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('R', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('Errors', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('Single', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('GIDP', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('XBH', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column('batters', sa.Column('AB', sa.INTEGER(), autoincrement=False, nullable=True)) op.drop_column('batters', 'PitcherWHIP') op.drop_column('batters', 'PitcherW') op.drop_column('batters', 'PitcherS') op.drop_column('batters', 'PitcherQS') op.drop_column('batters', 'PitcherL') op.drop_column('batters', 'PitcherK9') op.drop_column('batters', 'PitcherK') op.drop_column('batters', 'PitcherIP') op.drop_column('batters', 'PitcherHit') op.drop_column('batters', 'PitcherHRA') op.drop_column('batters', 'PitcherG') op.drop_column('batters', 'PitcherERA') op.drop_column('batters', 'PitcherER') op.drop_column('batters', 'PitcherBB') op.drop_column('batters', 'Hitterslg') op.drop_column('batters', 'Hitterops') op.drop_column('batters', 'Hitterobp') op.drop_column('batters', 'Hitteravg') op.drop_column('batters', 'HitterXBH') op.drop_column('batters', 'HitterTriple') op.drop_column('batters', 'HitterSingle') op.drop_column('batters', 'HitterSB') op.drop_column('batters', 'HitterRBI') op.drop_column('batters', 'HitterR') op.drop_column('batters', 'HitterPA') op.drop_column('batters', 'HitterK') op.drop_column('batters', 'HitterHit') op.drop_column('batters', 'HitterHR') op.drop_column('batters', 'HitterHBP') op.drop_column('batters', 'HitterGIDP') op.drop_column('batters', 'HitterErrors') op.drop_column('batters', 'HitterDouble') op.drop_column('batters', 'HitterCS') op.drop_column('batters', 'HitterBB') op.drop_column('batters', 'HitterAB')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('contracts', 'size', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True) op.alter_column('contracts', 'entry_price', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('LinRegResults', sa.Column('Id', sa.INTEGER(), server_default=sa.text('nextval(\'"LinRegResults_Id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('Name', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('YearsExperience', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('Prediction', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('Id', name='LinRegResults_pkey') ) op.drop_table('lin_reg_results')