def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('transactions', 'in_user_id', existing_type=sa.INTEGER(), nullable=False)
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( "organizations", sa.Column("id", sa.INTEGER(), nullable=False, comment="Unique row identifier"), sa.Column("name", sa.String(), nullable=False, comment="Unique name of Organization"), sa.Column( "description", sa.String(), nullable=True, comment="Short description of organization", ), sa.Column("addr_line1", sa.String(), nullable=False, comment="Address line 1"), sa.Column("addr_line2", sa.String(), nullable=True, comment="Address line 1"), sa.Column("country", sa.String(), nullable=False, comment="Country's ISO code"), sa.Column("city", sa.String(), nullable=False, comment="City's name"), sa.Column("contact_email", sa.String(), nullable=False), sa.Column("contact_phone", sa.String(), nullable=False), sa.Column("contact_user_id", sa.Integer(), nullable=False), sa.Column( "slug", sa.String(), nullable=False, comment="identifier slug for organization", ), sa.Column( "date_added", sa.DateTime(timezone=True), nullable=False, comment="row timestamp", ), sa.Column( "date_updated", sa.DateTime(timezone=True), nullable=False, comment="timestamp for last updated", ), sa.Column("added_by_id", sa.INTEGER(), nullable=True), sa.Column("updated_by_id", sa.INTEGER(), nullable=True, comment="fk for user's table"), sa.ForeignKeyConstraint( ["added_by_id"], ["users.id"], name=op.f("fk_organizations_added_by_id_users"), ), sa.ForeignKeyConstraint( ["contact_user_id"], ["users.id"], name=op.f("fk_organizations_contact_user_id_users"), ), sa.ForeignKeyConstraint( ["updated_by_id"], ["users.id"], name=op.f("fk_organizations_updated_by_id_users"), ), sa.PrimaryKeyConstraint("id", name=op.f("pk_organizations")), sa.UniqueConstraint("name", name=op.f("uq_organizations_name")), sa.UniqueConstraint("slug", name=op.f("uq_organizations_slug")), ) op.create_table( "organization_departments", sa.Column("id", sa.INTEGER(), nullable=False, comment="Unique row identifier"), sa.Column("org_id", sa.Integer(), nullable=True), sa.Column("name", sa.String(), nullable=False, comment="department's name"), sa.ForeignKeyConstraint( ["org_id"], ["organizations.id"], name=op.f("fk_organization_departments_org_id_organizations"), ), sa.PrimaryKeyConstraint("id", name=op.f("pk_organization_departments")), )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('goods_table', sa.Column('id', sa.INTEGER(), nullable=False)) op.drop_column('goods_table', 'goods_id')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('bridge', schema=None) as batch_op: batch_op.add_column(sa.Column('worker_id', sa.INTEGER(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'fyyur', sa.Column('venue_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('show_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('artist_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['artist_id'], ['artist.id'], name='fyyur_artist_id_fkey'), sa.ForeignKeyConstraint(['show_id'], ['show.id'], name='fyyur_show_id_fkey'), sa.ForeignKeyConstraint(['venue_id'], ['venue.id'], name='fyyur_venue_id_fkey')) op.create_table( 'show', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('start_time', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='show_pkey')) op.create_table( 'artist', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=False), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=False), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('image_link', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('facebook_link', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('seeking_description', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('seeking_venue', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('website', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('genres', postgresql.ARRAY(sa.VARCHAR(length=120)), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='artist_pkey')) op.create_table( 'venue', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=False), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=False), sa.Column('address', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('image_link', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('facebook_link', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('seeking_description', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('seeking_talent', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('website', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('genres', postgresql.ARRAY(sa.VARCHAR(length=120)), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='venue_pkey')) op.drop_table('shows') op.drop_table('venues') op.drop_table('artists')
def downgrade(): op.alter_column('job_application', 'jobpost_id', existing_type=sa.INTEGER(), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'Show', sa.Column('id', sa.INTEGER(), autoincrement=False, nullable=False))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_column('cab_deal', 'is_partner') op.add_column('cab', sa.Column('is_partner', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.create_table('cab_user', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('cab_user_id_seq'::regclass)"), nullable=False), sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('email', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='cab_user_pkey'), sa.UniqueConstraint('email', name='cab_user_email_key'), sa.UniqueConstraint('phone', name='cab_user_phone_key'), postgresql_ignore_search_path=False ) op.create_table('cab_booking', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('pickup_time', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.Column('drop_time', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.Column('drop_latitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('drop_longitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('pickup_latitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('pickup_longitude', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('cab_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('deal_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('booking_date', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('booking_status', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('cab_booking_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('mode_of_payment', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('total_distance', sa.NUMERIC(), autoincrement=False, nullable=True), sa.Column('total_fare', sa.NUMERIC(), autoincrement=False, nullable=True), sa.Column('total_hours', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('total_days', sa.INTEGER(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['cab_id'], ['cab.id'], name='cab_booking_cab_id_fkey'), sa.ForeignKeyConstraint(['deal_id'], ['cab_deal.id'], name='cab_booking_deal_id_fkey'), sa.ForeignKeyConstraint(['user_id'], ['cab_user.id'], name='cab_booking_user_id_fkey'), sa.PrimaryKeyConstraint('id', name='cab_booking_pkey') ) op.create_table('cab_tax', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('created_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('updated_at', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('gst', sa.NUMERIC(), autoincrement=False, nullable=True), sa.Column('s_gst', sa.NUMERIC(), autoincrement=False, nullable=True), sa.Column('c_gst', sa.NUMERIC(), autoincrement=False, nullable=True), sa.Column('booking_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('i_gst', sa.NUMERIC(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['booking_id'], ['cab_booking.id'], name='cab_tax_booking_id_fkey'), sa.PrimaryKeyConstraint('id', name='cab_tax_pkey'), sa.UniqueConstraint('booking_id', name='cab_tax_booking_id_key') )
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('reminder', 'author_id', existing_type=sa.INTEGER(), nullable=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('TOUR', sa.Column('location', sa.INTEGER(), autoincrement=False, nullable=False)) op.drop_constraint(None, 'TOUR', type_='foreignkey') op.create_foreign_key('TOUR_location_fkey', 'TOUR', 'LOCATION', ['location'], ['id']) op.drop_column('TOUR', 'location_id')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('posts', sa.Column('author', sa.INTEGER(), autoincrement=False, nullable=True)) op.drop_constraint(None, 'posts', type_='foreignkey') op.create_foreign_key('posts_author_fkey', 'posts', 'users', ['author'], ['id']) op.drop_column('posts', 'user_id')
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('tasks', 'task_number', existing_type=sa.INTEGER(), nullable=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('tag', schema=None) as batch_op: batch_op.add_column(sa.Column('post_id', sa.INTEGER(), nullable=True)) batch_op.add_column( sa.Column('software_id', sa.INTEGER(), nullable=True)) batch_op.drop_constraint(batch_op.f('fk_tag_softwareTag_id_software'), type_='foreignkey') batch_op.drop_constraint(batch_op.f('fk_tag_postTag_id_post'), type_='foreignkey') batch_op.create_foreign_key('fk_tag_software_id_software', 'software', ['software_id'], ['id']) batch_op.create_foreign_key('fk_tag_post_id_post', 'post', ['post_id'], ['id']) batch_op.drop_column('softwareTag_id') batch_op.drop_column('postTag_id') with op.batch_alter_table('similar', schema=None) as batch_op: batch_op.add_column(sa.Column('post_id', sa.INTEGER(), nullable=True)) batch_op.add_column( sa.Column('software_id', sa.INTEGER(), nullable=True)) batch_op.drop_constraint(batch_op.f('fk_similar_postSimilar_id_post'), type_='foreignkey') batch_op.drop_constraint( batch_op.f('fk_similar_softwarSimilare_id_software'), type_='foreignkey') batch_op.create_foreign_key('fk_similar_post_id_post', 'post', ['post_id'], ['id']) batch_op.create_foreign_key('fk_similar_software_id_software', 'software', ['software_id'], ['id']) batch_op.drop_column('softwarSimilare_id') batch_op.drop_column('postSimilar_id') with op.batch_alter_table('report', schema=None) as batch_op: batch_op.add_column(sa.Column('post_id', sa.INTEGER(), nullable=True)) batch_op.add_column( sa.Column('software_id', sa.INTEGER(), nullable=True)) batch_op.drop_constraint(batch_op.f('fk_report_postReport_id_post'), type_='foreignkey') batch_op.drop_constraint( batch_op.f('fk_report_softwareReport_id_software'), type_='foreignkey') batch_op.create_foreign_key('fk_report_software_id_software', 'software', ['software_id'], ['id']) batch_op.create_foreign_key('fk_report_post_id_post', 'post', ['post_id'], ['id']) batch_op.drop_column('softwareReport_id') batch_op.drop_column('postReport_id') with op.batch_alter_table('comment', schema=None) as batch_op: batch_op.add_column(sa.Column('post_id', sa.INTEGER(), nullable=True)) batch_op.add_column( sa.Column('software_id', sa.INTEGER(), nullable=True)) batch_op.drop_constraint( batch_op.f('fk_comment_softwareComment_id_software'), type_='foreignkey') batch_op.drop_constraint(batch_op.f('fk_comment_postComment_id_post'), type_='foreignkey') batch_op.create_foreign_key('fk_comment_software_id_software', 'software', ['software_id'], ['id']) batch_op.create_foreign_key('fk_comment_post_id_post', 'post', ['post_id'], ['id']) batch_op.drop_column('softwareComment_id') batch_op.drop_column('postComment_id') with op.batch_alter_table('category', schema=None) as batch_op: batch_op.add_column(sa.Column('post_id', sa.INTEGER(), nullable=True)) batch_op.add_column( sa.Column('software_id', sa.INTEGER(), nullable=True)) batch_op.drop_constraint( batch_op.f('fk_category_postCategory_id_post'), type_='foreignkey') batch_op.drop_constraint( batch_op.f('fk_category_softwareCategory_id_software'), type_='foreignkey') batch_op.create_foreign_key('fk_category_post_id_post', 'post', ['post_id'], ['id']) batch_op.create_foreign_key('fk_category_software_id_software', 'software', ['software_id'], ['id']) batch_op.drop_column('softwareCategory_id') batch_op.drop_column('postCategory_id')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('artifacts', sa.Column('concept_id', sa.INTEGER(), autoincrement=False, nullable=True)) op.create_foreign_key('artifacts_concept_id_fkey', 'artifacts', 'concepts', ['concept_id'], ['id'])
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_table('budget') op.drop_table('item') op.drop_table('purchase') op.drop_table('customer') op.create_table('customer', sa.Column('id', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('first_name', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.Column('last_name', sa.VARCHAR(length=50), autoincrement=False, nullable=True), sa.Column('email', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='customer_pkey'), postgresql_ignore_search_path=False) op.create_table( 'purchase', sa.Column( 'id', sa.INTEGER(), server_default=sa.text("nextval('purchase_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('customer_id', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('total_amount', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('date', postgresql.TIMESTAMP(), server_default=sa.func.current_timestamp(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['customer_id'], ['customer.id'], name='purchase_customer_id_fkey'), sa.PrimaryKeyConstraint('id', name='purchase_pkey'), postgresql_ignore_search_path=False) op.create_table( 'item', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('purchase_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('price', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('category', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('date', postgresql.TIMESTAMP(), server_default=sa.func.current_timestamp(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['purchase_id'], ['purchase.id'], name='item_purchase_id_fkey'), sa.PrimaryKeyConstraint('id', name='item_pkey')) op.create_table( 'budget', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('customer_id', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('budget', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('category', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('date', postgresql.TIMESTAMP(), server_default=sa.func.current_timestamp(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['customer_id'], ['customer.id'], name='budget_customer_id_fkey'), sa.PrimaryKeyConstraint('id', name='budget_pkey'))
def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table( 'batchhistory', sa.Column('batchid', sa.INTEGER(), nullable=False), sa.Column('userid', sa.INTEGER(), nullable=False), sa.Column('event', sa.TEXT(), nullable=False), sa.Column('when', postgresql.TIMESTAMP(timezone=True), server_default=sa.text(u'now()'), nullable=False), sa.ForeignKeyConstraint(['userid'], [u'users.userid'], name=u'batchhistory_userid_fkey'), sa.CheckConstraint( "event=ANY(ARRAY['assigned','abandoned','submitted','revoked'])"), ) op.create_index('batchhistorybyuserid', 'batchhistory', ['userid'], unique=False) op.create_table( 'pages', sa.Column('pageid', sa.INTEGER(), nullable=False), sa.Column('batchid', sa.INTEGER(), nullable=False), sa.Column('pageindex', sa.INTEGER(), nullable=False), sa.ForeignKeyConstraint(['batchid'], [u'batches.batchid'], name=u'pages_batchid_fkey'), sa.PrimaryKeyConstraint(u'pageid', name=op.f('pk_pages')), sa.CheckConstraint('pageindex>=0'), ) op.create_index('pages_batchid_key', 'pages', ['batchid', 'pageindex'], unique=True) op.create_index('pagesbybatchid', 'pages', ['batchid'], unique=False) op.create_table( 'abnormalusage', sa.Column('metricid', sa.INTEGER(), nullable=False), sa.Column('tagid', sa.INTEGER(), nullable=True), sa.Column('labelid', sa.INTEGER(), nullable=True), sa.Column('degree', sa.INTEGER(), nullable=False), sa.ForeignKeyConstraint(['labelid'], [u'labels.labelid'], name=u'abnormalusage_labelid_fkey'), sa.ForeignKeyConstraint(['metricid'], [u'subtaskmetrics.metricid'], name=u'abnormalusage_metricid_fkey'), sa.ForeignKeyConstraint(['tagid'], [u'tags.tagid'], name=u'abnormalusage_tagid_fkey'), sa.CheckConstraint( 'tagid IS NOT NULL AND labelid IS NULL OR tagid IS NULL AND labelid IS NOT NULL' ), sa.CheckConstraint('degree <> 0'), ) op.create_index('abnormalusagebymetricid', 'abnormalusage', ['metricid'], unique=False) op.create_table( 'rawpieces', sa.Column('rawpieceid', sa.INTEGER(), nullable=False), sa.Column('taskid', sa.INTEGER(), nullable=False), sa.Column('rawtext', sa.TEXT(), nullable=False), sa.Column('assemblycontext', sa.TEXT(), server_default=sa.text(u"''::text"), nullable=False), sa.Column('allocationcontext', sa.TEXT(), server_default=sa.text(u"''::text"), nullable=False), sa.Column('meta', sa.TEXT(), nullable=True), sa.Column('isnew', sa.BOOLEAN(), server_default=sa.text(u'true'), nullable=False), sa.Column('hypothesis', sa.TEXT(), nullable=True), sa.Column('words', sa.INTEGER(), server_default=sa.text(u'0'), nullable=True), sa.Column('groupid', sa.INTEGER(), nullable=True), sa.Column('loadid', sa.INTEGER(), nullable=False), sa.ForeignKeyConstraint(['groupid'], [u'postprocessingutterancegroups.groupid'], name=u'rawpieces_groupid_fkey'), sa.ForeignKeyConstraint(['taskid', 'loadid'], [u'loads.taskid', u'loads.loadid'], name=op.f('fk_rawpieces_taskid_loads')), sa.ForeignKeyConstraint(['taskid'], [u'tasks.taskid'], name=u'rawpieces_taskid_fkey'), sa.PrimaryKeyConstraint(u'rawpieceid', name=op.f('pk_rawpieces'))) op.create_index(op.f('ix_rawpieces_taskid'), 'rawpieces', ['taskid', 'assemblycontext'], unique=True) op.create_index('rawpieces_groupid', 'rawpieces', ['groupid'], unique=False) op.create_index('rawpieces_loadid', 'rawpieces', ['loadid'], unique=False) op.create_index('rawpieces_taskid', 'rawpieces', ['taskid'], unique=False) op.create_table( 'subtaskmetricerrors', sa.Column('metricid', sa.INTEGER(), nullable=False), sa.Column('errortypeid', sa.INTEGER(), nullable=False), sa.Column('occurences', sa.INTEGER(), nullable=False), sa.ForeignKeyConstraint(['errortypeid'], [u'errortypes.errortypeid'], name=u'subtaskmetricerrors_errortypeid_fkey'), sa.ForeignKeyConstraint(['metricid'], [u'subtaskmetrics.metricid'], name=u'subtaskmetricerrors_metricid_fkey'), sa.PrimaryKeyConstraint(u'metricid', u'errortypeid', name=op.f('pk_subtaskmetricerrors'))) op.create_index('subtaskmetricerrorsbymetricid', 'subtaskmetricerrors', ['metricid'], unique=False) op.create_table( 'utteranceselectionfilterpieces', sa.Column('filterid', sa.INTEGER(), nullable=False), sa.Column('pieceindex', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('data', sa.TEXT(), nullable=False), sa.ForeignKeyConstraint( ['filterid'], [u'utteranceselectionfilters.filterid'], name=u'utteranceselectionfilterpieces_filterid_fkey'), sa.PrimaryKeyConstraint( u'filterid', u'pieceindex', name=op.f('pk_utteranceselectionfilterpieces'))) op.create_table( 'customutterancegroupmembers', sa.Column('groupid', sa.INTEGER(), nullable=False), sa.Column('rawpieceid', sa.INTEGER(), nullable=False), sa.ForeignKeyConstraint( ['groupid'], [u'customutterancegroups.groupid'], name=u'customutterancegroupmembers_groupid_fkey'), sa.ForeignKeyConstraint( ['rawpieceid'], [u'rawpieces.rawpieceid'], name=u'customutterancegroupmembers_rawpieceid_fkey'), sa.PrimaryKeyConstraint(u'groupid', u'rawpieceid', name=op.f('pk_customutterancegroupmembers'))) op.create_index('customutterancegroupmember_by_rawpieceid', 'customutterancegroupmembers', ['rawpieceid'], unique=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('todos', 'list_id', existing_type=sa.INTEGER(), nullable=True)
def downgrade(): op.alter_column('node_instances', 'version', existing_type=sa.INTEGER(), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'team', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('team_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('full_team_name', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('team_name_slug', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('url_name_slug', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('base', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('team_chief', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('technical_chief', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('power_unit', sa.VARCHAR(length=50), autoincrement=False, nullable=True), sa.Column('first_team_entry', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('highest_race_finish', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('pole_positions', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('fastest_laps', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('main_image', sa.VARCHAR(length=200), autoincrement=False, nullable=True), sa.Column('flag_img_url', sa.VARCHAR(length=200), autoincrement=False, nullable=True), sa.Column('logo_url', sa.VARCHAR(length=200), autoincrement=False, nullable=True), sa.Column('podium_finishes', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('championship_titles', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('drivers_scraped', postgresql.BYTEA(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='team_pkey'), sa.UniqueConstraint('full_team_name', name='team_full_team_name_key'), sa.UniqueConstraint('team_name_slug', name='team_team_name_slug_key'), postgresql_ignore_search_path=False) op.create_table( 'driver', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('driver_name', sa.VARCHAR(length=80), autoincrement=False, nullable=False), sa.Column('country', sa.VARCHAR(length=100), autoincrement=False, nullable=True), sa.Column('name_slug', sa.VARCHAR(length=80), autoincrement=False, nullable=False), sa.Column('date_of_birth', sa.VARCHAR(length=20), autoincrement=False, nullable=True), sa.Column('driver_number', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('place_of_birth', sa.VARCHAR(length=50), autoincrement=False, nullable=True), sa.Column('flag_img_url', sa.VARCHAR(length=150), autoincrement=False, nullable=True), sa.Column('main_image', sa.VARCHAR(length=150), autoincrement=False, nullable=True), sa.Column('podiums', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('world_championships', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('highest_grid_position', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('points', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('position', sa.VARCHAR(length=10), autoincrement=False, nullable=True), sa.Column('team', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.Column('team_name_slug', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.Column('team_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['team_id'], ['team.id'], name='driver_team_id_fkey', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id', name='driver_pkey'), sa.UniqueConstraint('name_slug', name='driver_name_slug_key')) op.create_table( 'user', sa.Column('id', sa.BIGINT(), autoincrement=True, nullable=False), sa.Column('username', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('password', postgresql.BYTEA(), autoincrement=False, nullable=False), sa.Column('driver_data', postgresql.BYTEA(), autoincrement=False, nullable=True), sa.Column('team_data', postgresql.BYTEA(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='user_pkey'), sa.UniqueConstraint('username', name='user_username_key'))
op.execute('DROP SCHEMA bixie') ### end Alembic commands ### def downgrade(): ### commands auto generated by Alembic - please adjust! ### try: op.execute('CREATE SCHEMA IF NOT EXISTS bixie') except ProgrammingError, e: if re.search( 'syntax error at or near "NOT"', e.orig.pgerror.strip()): op.execute('rollback') op.execute('CREATE SCHEMA bixie') op.create_table('full_urls', sa.Column('id', sa.INTEGER(), sa.Sequence('bixie.full_urls_id_seq'), nullable=False), sa.Column('url', sa.TEXT(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name=u'full_urls_pkey'), schema='bixie' ) op.create_table('raw_product_releases', sa.Column('id', sa.INTEGER(), sa.Sequence('bixie.raw_product_releases_id_seq'), nullable=False), sa.Column('version', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('build', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('build_type', citexttype.CitextType(), autoincrement=False, nullable=False), sa.Column('platform', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('product_name', citexttype.CitextType, autoincrement=False, nullable=False), sa.Column('repository', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('stability', sa.TEXT(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name=u'raw_product_releases_pkey'), schema='bixie'
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('cards', 'organism_id', existing_type=sa.INTEGER(), nullable=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('member_relationships', 'membership_type_id', existing_type=sa.INTEGER(), nullable=True)
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('LIL_TABLE', sa.Column('T_ID', sa.INTEGER(), nullable=True) )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('jira_work_stat', sa.Column('total_worklog', sa.INTEGER(), autoincrement=False, nullable=True)) op.drop_column('jira_work_stat', 'not_completed_worklog')
class _array_search(expression.FunctionElement): type = sa.INTEGER() name = 'array_search'
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('usuari', sa.Column('id', sa.INTEGER(), nullable=False), sa.Column('nom', sa.VARCHAR(length=100), nullable=True), sa.PrimaryKeyConstraint('id')) op.drop_table('user')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'shot', sa.Column('numV', sa.INTEGER(), autoincrement=False, nullable=True)) op.drop_column('shot', 'vScore')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('shops_products', 'amount', existing_type=sa.INTEGER(), nullable=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_column('program', 'trello_board_id') op.add_column('opportunity', sa.Column('cycle_id', sa.INTEGER(), autoincrement=False, nullable=False)) op.drop_constraint('opportunity_program_id_fkey', 'opportunity', type_='foreignkey') op.drop_column('opportunity', 'program_id') op.create_foreign_key('opportunity_cycle_id_fkey', 'opportunity', 'cycle', ['cycle_id'], ['id']) op.add_column('contact', sa.Column('pronouns', sa.VARCHAR(length=100), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('race_other', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('birthdate', sa.DATE(), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('gender_other', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('gender', sa.VARCHAR(length=100), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('pronouns_other', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('salutation', postgresql.ENUM('miss', 'mrs', 'mr', 'ms', 'dr', name='Salutation'), autoincrement=False, nullable=True)) op.add_column('contact', sa.Column('race_all', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.drop_column('contact', 'stage') op.drop_column('contact', 'email') op.create_table('response', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('program_contact_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('question_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('response_text', sa.VARCHAR(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['program_contact_id'], ['program_contact.id'], name='response_program_contact_id_fkey'), sa.ForeignKeyConstraint(['question_id'], ['question.id'], name='response_question_id_fkey'), sa.PrimaryKeyConstraint('id', name='response_pkey') ) op.create_table('review', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('score', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('stage', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('is_active', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('card_id', sa.VARCHAR(length=25), autoincrement=False, nullable=True), sa.Column('program_contact_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['program_contact_id'], ['program_contact.id'], name='review_program_contact_id_fkey'), sa.PrimaryKeyConstraint('id', name='review_pkey') ) op.create_table('cycle', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('program_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('date_start', sa.DATE(), autoincrement=False, nullable=False), sa.Column('date_end', sa.DATE(), autoincrement=False, nullable=False), sa.Column('intake_talent_board_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('intake_org_board_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('match_talent_board_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('match_opp_board_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('review_talent_board_id', sa.VARCHAR(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['program_id'], ['program.id'], name='cycle_program_id_fkey'), sa.PrimaryKeyConstraint('id', name='cycle_pkey') ) op.create_table('question', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('program_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('question_text', sa.VARCHAR(length=500), autoincrement=False, nullable=False), sa.Column('limit_word', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('limit_character', sa.INTEGER(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['program_id'], ['program.id'], name='question_program_id_fkey'), sa.PrimaryKeyConstraint('id', name='question_pkey') ) op.create_table('address', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('contact_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('is_primary', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('street1', sa.VARCHAR(length=200), autoincrement=False, nullable=False), sa.Column('street2', sa.VARCHAR(length=200), autoincrement=False, nullable=True), sa.Column('city', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('state', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('country', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('postal_code', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.Column('type', postgresql.ENUM('home', 'work', name='AddressType'), autoincrement=False, nullable=True), sa.Column('status', postgresql.ENUM('active', 'inactive', name='Status'), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['contact_id'], ['contact.id'], name='address_contact_id_fkey'), sa.PrimaryKeyConstraint('id', name='address_pkey') ) op.drop_table('role_choice') op.drop_table('race') op.drop_table('programs_completed') op.drop_table('contact_address') op.drop_table('program_app') op.drop_table('profile')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('stats', sa.Column('intercseptios', sa.INTEGER(), autoincrement=False, nullable=True)) op.drop_column('stats', 'interceptions')