def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('auth_permission', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('auth_permission_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('content_type_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('codename', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['content_type_id'], ['django_content_type.id'], name='auth_permission_content_type_id_2f476e4b_fk_django_co', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='auth_permission_pkey'), sa.UniqueConstraint('content_type_id', 'codename', name='auth_permission_content_type_id_codename_01ab375a_uniq'), postgresql_ignore_search_path=False ) op.create_index('auth_permission_content_type_id_2f476e4b', 'auth_permission', ['content_type_id'], unique=False) op.create_table('auth_group', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('auth_group_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(length=80), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='auth_group_pkey'), sa.UniqueConstraint('name', name='auth_group_name_key'), postgresql_ignore_search_path=False ) op.create_index('auth_group_name_a6ea08ec_like', 'auth_group', ['name'], unique=False) op.create_table('home_bodytype', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('home_bodytype_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('bodyTypeName', sa.VARCHAR(length=20), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='home_bodytype_pkey'), postgresql_ignore_search_path=False ) op.create_table('auth_user_user_permissions', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('permission_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['permission_id'], ['auth_permission.id'], name='auth_user_user_permi_permission_id_1fbb5f2c_fk_auth_perm', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['user_id'], ['auth_user.id'], name='auth_user_user_permissions_user_id_a95ead1b_fk_auth_user_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='auth_user_user_permissions_pkey'), sa.UniqueConstraint('user_id', 'permission_id', name='auth_user_user_permissions_user_id_permission_id_14a6b632_uniq') ) op.create_index('auth_user_user_permissions_user_id_a95ead1b', 'auth_user_user_permissions', ['user_id'], unique=False) op.create_index('auth_user_user_permissions_permission_id_1fbb5f2c', 'auth_user_user_permissions', ['permission_id'], unique=False) op.create_table('django_session', sa.Column('session_key', sa.VARCHAR(length=40), autoincrement=False, nullable=False), sa.Column('session_data', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('expire_date', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('session_key', name='django_session_pkey') ) op.create_index('django_session_session_key_c0390e0f_like', 'django_session', ['session_key'], unique=False) op.create_index('django_session_expire_date_a5c62663', 'django_session', ['expire_date'], unique=False) op.create_table('home_colour', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('home_colour_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('colourNum', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('colourHex', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='home_colour_pkey'), postgresql_ignore_search_path=False ) op.create_table('home_beer_containerType', sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"home_beer_containerType_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('beer_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('containertype_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['beer_id'], ['home_beer.id'], name='home_beer_containerType_beer_id_0647fd28_fk_home_beer_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['containertype_id'], ['home_containertype.id'], name='home_beer_containerT_containertype_id_45ef3f16_fk_home_cont', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='home_beer_containerType_pkey'), sa.UniqueConstraint('beer_id', 'containertype_id', name='home_beer_containertype_beer_id_containertype_id_b6071859_uniq') ) op.create_index('home_beer_containerType_containertype_id_45ef3f16', 'home_beer_containerType', ['containertype_id'], unique=False) op.create_index('home_beer_containerType_beer_id_0647fd28', 'home_beer_containerType', ['beer_id'], unique=False) op.create_table('home_beer', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('home_beer_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('beerName', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.Column('alcoholVolume', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('bodyType_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('brand_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('bottlePrice', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('canPrice', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('kegPrice', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True), sa.Column('beerPhoto', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('colour_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['bodyType_id'], ['home_bodytype.id'], name='home_beer_bodyType_id_f0ecc2f1_fk_home_bodytype_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['brand_id'], ['home_brand.id'], name='home_beer_brand_id_f16fd460_fk_home_brand_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['colour_id'], ['home_colour.id'], name='home_beer_colour_id_655f6fb5_fk_home_colour_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='home_beer_pkey'), postgresql_ignore_search_path=False ) op.create_index('home_beer_colour_id_655f6fb5', 'home_beer', ['colour_id'], unique=False) op.create_index('home_beer_brand_id_f16fd460', 'home_beer', ['brand_id'], unique=False) op.create_index('home_beer_bodyType_id_f0ecc2f1', 'home_beer', ['bodyType_id'], unique=False) op.create_table('home_taste', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('home_taste_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('tasteName', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='home_taste_pkey'), postgresql_ignore_search_path=False ) op.create_table('auth_user_groups', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('group_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['group_id'], ['auth_group.id'], name='auth_user_groups_group_id_97559544_fk_auth_group_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['user_id'], ['auth_user.id'], name='auth_user_groups_user_id_6a12ed8b_fk_auth_user_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='auth_user_groups_pkey'), sa.UniqueConstraint('user_id', 'group_id', name='auth_user_groups_user_id_group_id_94350c0c_uniq') ) op.create_index('auth_user_groups_user_id_6a12ed8b', 'auth_user_groups', ['user_id'], unique=False) op.create_index('auth_user_groups_group_id_97559544', 'auth_user_groups', ['group_id'], unique=False) op.create_table('home_containertype', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('containerTypeName', sa.VARCHAR(length=20), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='home_containertype_pkey') ) op.create_table('django_content_type', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('django_content_type_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('app_label', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.Column('model', sa.VARCHAR(length=100), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='django_content_type_pkey'), sa.UniqueConstraint('app_label', 'model', name='django_content_type_app_label_model_76bd3d3b_uniq'), postgresql_ignore_search_path=False ) op.create_table('django_admin_log', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('action_time', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.Column('object_id', sa.TEXT(), autoincrement=False, nullable=True), sa.Column('object_repr', sa.VARCHAR(length=200), autoincrement=False, nullable=False), sa.Column('action_flag', sa.SMALLINT(), autoincrement=False, nullable=False), sa.Column('change_message', sa.TEXT(), autoincrement=False, nullable=False), sa.Column('content_type_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.CheckConstraint('action_flag >= 0', name='django_admin_log_action_flag_check'), sa.ForeignKeyConstraint(['content_type_id'], ['django_content_type.id'], name='django_admin_log_content_type_id_c4bce8eb_fk_django_co', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['user_id'], ['auth_user.id'], name='django_admin_log_user_id_c564eba6_fk_auth_user_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='django_admin_log_pkey') ) op.create_index('django_admin_log_user_id_c564eba6', 'django_admin_log', ['user_id'], unique=False) op.create_index('django_admin_log_content_type_id_c4bce8eb', 'django_admin_log', ['content_type_id'], unique=False) op.create_table('home_brand', sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('home_brand_id_seq'::regclass)"), autoincrement=True, nullable=False), sa.Column('brandName', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.Column('countryOfOrigin', sa.VARCHAR(length=50), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='home_brand_pkey'), postgresql_ignore_search_path=False ) op.create_table('django_migrations', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('app', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('applied', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='django_migrations_pkey') ) op.create_table('auth_group_permissions', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('group_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('permission_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['group_id'], ['auth_group.id'], name='auth_group_permissions_group_id_b120cbf9_fk_auth_group_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['permission_id'], ['auth_permission.id'], name='auth_group_permissio_permission_id_84c5c92e_fk_auth_perm', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='auth_group_permissions_pkey'), sa.UniqueConstraint('group_id', 'permission_id', name='auth_group_permissions_group_id_permission_id_0cd325b0_uniq') ) op.create_index('auth_group_permissions_permission_id_84c5c92e', 'auth_group_permissions', ['permission_id'], unique=False) op.create_index('auth_group_permissions_group_id_b120cbf9', 'auth_group_permissions', ['group_id'], unique=False) op.create_table('auth_user', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('password', sa.VARCHAR(length=128), autoincrement=False, nullable=False), sa.Column('last_login', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=True), sa.Column('is_superuser', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('username', sa.VARCHAR(length=150), autoincrement=False, nullable=False), sa.Column('first_name', sa.VARCHAR(length=30), autoincrement=False, nullable=False), sa.Column('last_name', sa.VARCHAR(length=150), autoincrement=False, nullable=False), sa.Column('email', sa.VARCHAR(length=254), autoincrement=False, nullable=False), sa.Column('is_staff', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('is_active', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('date_joined', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='auth_user_pkey'), sa.UniqueConstraint('username', name='auth_user_username_key') ) op.create_index('auth_user_username_6821ab7c_like', 'auth_user', ['username'], unique=False) op.create_table('home_rating', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('ratingValue', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('date', postgresql.TIMESTAMP(timezone=True), autoincrement=False, nullable=False), sa.Column('beer_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('reviewText', sa.TEXT(), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['beer_id'], ['home_beer.id'], name='home_rating_beer_id_019c613b_fk_home_beer_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='home_rating_pkey') ) op.create_index('home_rating_beer_id_019c613b', 'home_rating', ['beer_id'], unique=False) op.create_table('home_beer_taste', sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False), sa.Column('beer_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('taste_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['beer_id'], ['home_beer.id'], name='home_beer_taste_beer_id_776e787e_fk_home_beer_id', initially='DEFERRED', deferrable=True), sa.ForeignKeyConstraint(['taste_id'], ['home_taste.id'], name='home_beer_taste_taste_id_7dff3de0_fk_home_taste_id', initially='DEFERRED', deferrable=True), sa.PrimaryKeyConstraint('id', name='home_beer_taste_pkey'), sa.UniqueConstraint('beer_id', 'taste_id', name='home_beer_taste_beer_id_taste_id_1ded2dcd_uniq') ) op.create_index('home_beer_taste_taste_id_7dff3de0', 'home_beer_taste', ['taste_id'], unique=False) op.create_index('home_beer_taste_beer_id_776e787e', 'home_beer_taste', ['beer_id'], unique=False)
def upgrade(): op.add_column( 'vehicle_journey', sa.Column('is_frequency', sa.BOOLEAN(), nullable=True, default=False), schema='navitia', )
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'IMAGE', sa.Column('primary', sa.BOOLEAN(), autoincrement=False, nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('micro_blog_post', sa.Column('isEdited', sa.BOOLEAN(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('venue', sa.Column('seeking_venue', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.drop_column('venue', 'seeking_talent')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'transactions', sa.Column('customer_id', postgresql.UUID(), autoincrement=False, nullable=True)) op.add_column( 'transactions', sa.Column('kaggle_raw_data_id', postgresql.UUID(), autoincrement=False, nullable=True)) op.drop_constraint(None, 'transactions', type_='foreignkey') op.drop_constraint(None, 'transactions', type_='foreignkey') op.create_foreign_key('transactions_customer_id_fkey', 'transactions', 'customers', ['customer_id'], ['id']) op.create_foreign_key('transactions_kaggle_raw_data_id_fkey', 'transactions', 'kaggle_raw_data', ['kaggle_raw_data_id'], ['id']) op.drop_column('transactions', 'kaggle_raw_data') op.drop_column('transactions', 'customer') op.alter_column('products', 'category', existing_type=sa.VARCHAR(length=255), nullable=False) op.alter_column('products', 'name', existing_type=sa.VARCHAR(length=255), nullable=False) op.add_column( 'customers', sa.Column('spc_raw_data_id', postgresql.UUID(), autoincrement=False, nullable=True)) op.drop_constraint(None, 'customers', type_='foreignkey') op.create_foreign_key('customers_raw_data_id_fkey', 'customers', 'spc_raw_data', ['spc_raw_data_id'], ['id']) op.drop_column('customers', 'spc_raw_data') op.create_table( 'kaggle_raw_data', sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False), sa.Column('customer_id', postgresql.UUID(), autoincrement=False, nullable=True), sa.Column('reference_id', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('branch', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('city', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('state', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('age', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('gender', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('total_limit', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('available_limit', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('date', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('value', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('group', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('purchase_city', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('purchase_country', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.ForeignKeyConstraint(['customer_id'], ['customers.id'], name='kaggle_raw_data_customer_id_fkey'), sa.PrimaryKeyConstraint('id', name='kaggle_raw_data_pkey')) op.create_table('spc_raw_data', sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False), sa.Column('birthday', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('avg_income', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('latitude', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('longitude', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='raw_data_pkey'), postgresql_ignore_search_path=False) op.create_table( 'schema_migrations', sa.Column('version', sa.BIGINT(), autoincrement=False, nullable=False), sa.Column('inserted_at', postgresql.TIMESTAMP(precision=0), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('version', name='schema_migrations_pkey')) op.create_table( 'customers_products', sa.Column('id', postgresql.UUID(), server_default=sa.text('uuid_generate_v4()'), autoincrement=False, nullable=False), sa.Column('active', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False), sa.Column('customer_id', postgresql.UUID(), autoincrement=False, nullable=True), sa.Column('product_id', postgresql.UUID(), autoincrement=False, nullable=True), sa.Column('inserted_at', postgresql.TIMESTAMP(precision=0), autoincrement=False, nullable=False), sa.Column('updated_at', postgresql.TIMESTAMP(precision=0), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['customer_id'], ['customers.id'], name='customers_products_customer_id_fkey', ondelete='CASCADE'), sa.ForeignKeyConstraint(['product_id'], ['products.id'], name='customers_products_product_id_fkey', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id', name='customers_products_pkey')) op.drop_table('kagglerawdata') op.drop_table('customersproducts') op.drop_table('users') op.drop_table('spcrawdata') op.drop_table('schemamigrations')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('user_info', sa.Column('ldap_cn', sa.VARCHAR(), autoincrement=False, nullable=False)) op.add_column('user_info', sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False)) op.drop_column('user_info', 'last_auth') op.add_column('document_hist', sa.Column('deleted', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column( 'users', sa.Column('is_admin', sa.BOOLEAN(), autoincrement=False, nullable=True))
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('Gliders', sa.Column('UEAGlider', sa.BOOLEAN(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.drop_constraint(None, 'shows', type_='foreignkey') op.drop_constraint(None, 'shows', type_='foreignkey') op.drop_constraint(None, 'shows', type_='foreignkey') op.drop_constraint(None, 'shows', type_='foreignkey') op.drop_constraint(None, 'shows', type_='foreignkey') op.create_foreign_key('shows_artist_id_fkey', 'shows', 'Artist', ['artist_id'], ['id']) op.create_foreign_key('shows_venue_id_fkey', 'shows', 'Venue', ['venue_id'], ['id']) op.drop_column('shows', 'venue_name') op.drop_column('shows', 'artist_name') op.drop_column('shows', 'artist_image_link') op.create_table( 'ArtistGenre', sa.Column('id', sa.INTEGER(), server_default=sa.text( 'nextval(\'"ArtistGenre_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('category', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('artist_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('artist_name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['artist_id'], ['Artist.id'], name='ArtistGenre_artist_id_fkey'), sa.ForeignKeyConstraint(['artist_name'], ['Artist.name'], name='ArtistGenre_artist_name_fkey'), sa.PrimaryKeyConstraint('id', name='ArtistGenre_pkey')) op.create_table( 'Venue', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Venue_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('address', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('website', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('facebook_link', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('seeking_talent', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('seeking_description', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('image_link', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='Venue_pkey'), sa.UniqueConstraint('name', name='Venue_name_key'), postgresql_ignore_search_path=False) op.create_table( 'Artist', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Artist_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('website', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('facebook_link', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('seeking_venue', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('seeking_description', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('image_link', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='Artist_pkey'), sa.UniqueConstraint('name', name='Artist_name_key')) op.create_table( 'VenueGenre', sa.Column('id', sa.INTEGER(), server_default=sa.text( 'nextval(\'"VenueGenre_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('category', sa.VARCHAR(), autoincrement=False, nullable=False), sa.Column('venue_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('venue_name', sa.VARCHAR(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['venue_id'], ['Venue.id'], name='VenueGenre_venue_id_fkey'), sa.ForeignKeyConstraint(['venue_name'], ['Venue.name'], name='VenueGenre_venue_name_fkey'), sa.PrimaryKeyConstraint('id', name='VenueGenre_pkey')) op.drop_table('venue_genre') op.drop_table('artist_genre') op.drop_table('venues') op.drop_table('artists')
def upgrade(): ### commands auto generated by Alembic - please adjust! ### op.create_table('agg_stats', sa.Column('metric', sa.VARCHAR(length=190), nullable=False), sa.Column('agg_ts', sa.DATETIME(), nullable=False), sa.Column('scale', mysql.DOUBLE(), nullable=False), sa.Column('count', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('first', sa.DATETIME(), nullable=True), sa.Column('last', sa.DATETIME(), nullable=True), sa.PrimaryKeyConstraint('metric', 'agg_ts') ) op.create_table('wordpress', sa.Column('uid', sa.VARCHAR(length=40), nullable=False), sa.Column('created_at', sa.DATETIME(), nullable=False), sa.Column('entry_type', sa.VARCHAR(length=40), nullable=False), sa.Column('title', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('text', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('msg', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('username', sa.VARCHAR(length=100), nullable=True), sa.Column('userid', sa.VARCHAR(length=100), nullable=True), sa.PrimaryKeyConstraint('uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' ) op.create_table('tumblr', sa.Column('uid', sa.VARCHAR(length=40), nullable=False), sa.Column('created_at', sa.DATETIME(), nullable=False), sa.Column('entry_type', sa.VARCHAR(length=40), nullable=False), sa.Column('text', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('msg', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('username', sa.VARCHAR(length=100), nullable=True), sa.Column('userid', sa.VARCHAR(length=100), nullable=True), sa.PrimaryKeyConstraint('uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' ) op.create_table('twitter', sa.Column('uid', sa.VARCHAR(length=40), nullable=False), sa.Column('created_at', sa.DATETIME(), nullable=False), sa.Column('retweet', sa.BOOLEAN(), nullable=False), sa.Column('text', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('msg', mysql.MEDIUMTEXT(convert_unicode=True), nullable=True), sa.Column('ref_uid', sa.VARCHAR(length=40), nullable=True), sa.Column('username', sa.VARCHAR(length=100), nullable=True), sa.Column('userid', sa.VARCHAR(length=100), nullable=True), sa.PrimaryKeyConstraint('uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' ) op.create_table('wordpress_samples', sa.Column('metric', sa.VARCHAR(length=190), nullable=False), sa.Column('msg_uid', sa.VARCHAR(length=40), server_default='', nullable=False), sa.Column('agg_ts', sa.DATETIME(), nullable=False), sa.ForeignKeyConstraint(['msg_uid'], [u'wordpress.uid'], name='wordpress_samples_to_wordpress_fk', onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('metric', 'msg_uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' ) op.create_table('tumblr_samples', sa.Column('metric', sa.VARCHAR(length=190), nullable=False), sa.Column('msg_uid', sa.VARCHAR(length=40), server_default='', nullable=False), sa.Column('agg_ts', sa.DATETIME(), nullable=False), sa.ForeignKeyConstraint(['msg_uid'], [u'tumblr.uid'], name='tumblr_samples_to_tumblr_fk', onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('metric', 'msg_uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' ) op.create_table('twitter_samples', sa.Column('metric', sa.VARCHAR(length=190), nullable=False), sa.Column('msg_uid', sa.VARCHAR(length=40), server_default='', nullable=False), sa.Column('agg_ts', sa.DATETIME(), nullable=False), sa.ForeignKeyConstraint(['msg_uid'], [u'twitter.uid'], name='twitter_samples_to_twitter_fk', onupdate='CASCADE', ondelete='CASCADE'), sa.PrimaryKeyConstraint('metric', 'msg_uid'), mysql_CHARSET='utf8', mysql_COLLATE='utf8_unicode_ci' )
def upgrade(): op.add_column( 'users', sa.Column('active', sa.BOOLEAN(), nullable=False, default=True))
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('vendors', 'is_deleted', existing_type=sa.BOOLEAN(), nullable=False)
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('Assignment', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('Assignment', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('AssignmentLinter', 'Assignment_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('AssignmentLinter', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('AutoTestRun', 'job_id', existing_type=postgresql.UUID(), nullable=False) op.alter_column('AutoTestRunner', 'last_heartbeat', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('Comment', 'comment', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('Course', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('Course_Role', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('File', 'is_directory', existing_type=sa.BOOLEAN(), nullable=False) op.alter_column('File', 'modification_date', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('GradeHistory', 'changed_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('Group', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('GroupSet', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('LTIProvider', 'key', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('LinterComment', 'File_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('LinterComment', 'line', existing_type=sa.INTEGER(), nullable=False) op.alter_column('LinterComment', 'linter_code', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('LinterComment', 'linter_id', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('LinterInstance', 'Work_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('LinterInstance', 'tester_id', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('Permission', 'course_permission', existing_type=sa.BOOLEAN(), nullable=False) op.alter_column('Permission', 'default_value', existing_type=sa.BOOLEAN(), nullable=False) op.alter_column('Permission', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('PlagiarismCase', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('PlagiarismRun', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('Role', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('RubricItem', 'Rubricrow_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('RubricItem', 'description', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('RubricItem', 'header', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('RubricItem', 'points', existing_type=postgresql.DOUBLE_PRECISION(precision=53), nullable=False) op.alter_column('RubricRow', 'header', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('User', 'active', existing_type=sa.BOOLEAN(), nullable=False) op.alter_column('User', 'name', existing_type=sa.VARCHAR(), nullable=False) op.alter_column('Work', 'created_at', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False) op.alter_column('auto_test_output_file', 'auto_test_result_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('auto_test_output_file', 'modification_date', existing_type=postgresql.TIMESTAMP(timezone=True), nullable=False)
def upgrade(): op.add_column('t_tournaments', sa.Column('finished', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=False))
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column('payout', sa.Column('merged', sa.BOOLEAN(), server_default='false', nullable=True)) op.add_column('bonus_payout', sa.Column('merged', sa.BOOLEAN(), server_default='false', nullable=True)) op.add_column('block', sa.Column('merged', sa.BOOLEAN(), server_default='false', nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('todolists', 'completed', existing_type=sa.BOOLEAN(), nullable=True)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('task', sa.Column('is_accomplished', sa.BOOLEAN(), server_default=sa.text('false'), autoincrement=False, nullable=True)) op.drop_column('task', 'is_done')
def upgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_index(op.f('ix_animals_mbti'), 'animals', ['mbti'], unique=True) op.add_column('hearts', sa.Column('accpeted', sa.BOOLEAN(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table('Role', sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"Role_id_seq"\'::regclass)'), nullable=False), sa.Column('name', sa.VARCHAR(length=125), autoincrement=False, nullable=False), sa.Column('description', sa.VARCHAR(length=500), autoincrement=False, nullable=False), sa.Column('createAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('updateAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='Role_pkey'), sa.UniqueConstraint('name', name='Role_name_key'), postgresql_ignore_search_path=False ) op.create_table('Account', sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"Account_id_seq"\'::regclass)'), nullable=False), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('account_no', sa.VARCHAR(length=32), autoincrement=False, nullable=False), sa.Column('subkey', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('description', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('type', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.Column('currency', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.Column('balance', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('subkey_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('lastest_transaction_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('live', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('createAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='Account_pkey'), sa.UniqueConstraint('account_no', name='Account_account_no_key') ) op.create_index('ix_Account_type', 'Account', ['type'], unique=False) op.create_index('ix_Account_subkey', 'Account', ['subkey'], unique=False) op.create_index('ix_Account_currency', 'Account', ['currency'], unique=False) op.create_index('ix_Account_createAt', 'Account', ['createAt'], unique=False) op.create_index('ix_Account_balance', 'Account', ['balance'], unique=False) op.create_table('Transaction', sa.Column('id', sa.VARCHAR(length=64), autoincrement=False, nullable=False), sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('account_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('account_no', sa.VARCHAR(length=32), autoincrement=False, nullable=False), sa.Column('approver_name', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('kind', sa.VARCHAR(length=4), autoincrement=False, nullable=False), sa.Column('type', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.Column('currency', sa.VARCHAR(length=10), autoincrement=False, nullable=False), sa.Column('value', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=False), sa.Column('description', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('deposit_method', sa.VARCHAR(length=32), autoincrement=False, nullable=False), sa.Column('transaction_hash', sa.VARCHAR(length=500), autoincrement=False, nullable=False), sa.Column('status', sa.VARCHAR(length=1), autoincrement=False, nullable=False), sa.Column('live', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('createAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('updateAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='Transaction_pkey') ) op.create_index('ix_Transaction_value', 'Transaction', ['value'], unique=False) op.create_index('ix_Transaction_updateAt', 'Transaction', ['updateAt'], unique=False) op.create_index('ix_Transaction_type', 'Transaction', ['type'], unique=False) op.create_index('ix_Transaction_status', 'Transaction', ['status'], unique=False) op.create_index('ix_Transaction_currency', 'Transaction', ['currency'], unique=False) op.create_index('ix_Transaction_createAt', 'Transaction', ['createAt'], unique=False) op.create_table('User', sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"User_id_seq"\'::regclass)'), nullable=False), sa.Column('username', sa.VARCHAR(length=250), autoincrement=False, nullable=False), sa.Column('password', sa.VARCHAR(length=250), autoincrement=False, nullable=False), sa.Column('passwordresettoken', sa.VARCHAR(length=250), autoincrement=False, nullable=True), sa.Column('passwordresetexpires', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('confirmed', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('confirmed_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('email', sa.VARCHAR(length=250), autoincrement=False, nullable=False), sa.Column('phone', sa.VARCHAR(length=30), autoincrement=False, nullable=False), sa.Column('facebook', sa.VARCHAR(length=250), autoincrement=False, nullable=True), sa.Column('google', sa.VARCHAR(length=250), autoincrement=False, nullable=True), sa.Column('linkin', sa.VARCHAR(length=250), autoincrement=False, nullable=True), sa.Column('live', sa.BOOLEAN(), autoincrement=False, nullable=False), sa.Column('createAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('updateAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('role', sa.VARCHAR(length=125), autoincrement=False, nullable=False), sa.PrimaryKeyConstraint('id', name='User_pkey'), sa.UniqueConstraint('email', name='User_email_key'), sa.UniqueConstraint('phone', name='User_phone_key'), sa.UniqueConstraint('username', name='User_username_key') ) op.create_table('Permission', sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"Permission_id_seq"\'::regclass)'), nullable=False), sa.Column('role_id', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('permission', sa.VARCHAR(length=125), autoincrement=False, nullable=False), sa.Column('permissionID', sa.VARCHAR(length=125), autoincrement=False, nullable=False), sa.Column('createAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.Column('updateAt', postgresql.TIMESTAMP(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['role_id'], ['Role.id'], name='Permission_role_id_fkey'), sa.PrimaryKeyConstraint('id', name='Permission_pkey'), sa.UniqueConstraint('permissionID', name='Permission_permissionID_key') ) op.drop_index(op.f('ix_SubKey_updateAt'), table_name='SubKey') op.drop_index(op.f('ix_SubKey_createAt'), table_name='SubKey') op.drop_index(op.f('ix_SubKey_balance'), table_name='SubKey') op.drop_table('SubKey') op.drop_index(op.f('ix_RootKey_updateAt'), table_name='RootKey') op.drop_index(op.f('ix_RootKey_createAt'), table_name='RootKey') op.drop_table('RootKey') op.drop_index(op.f('ix_MasterKey_updateAt'), table_name='MasterKey') op.drop_index(op.f('ix_MasterKey_createAt'), table_name='MasterKey') op.drop_table('MasterKey')
def downgrade(): op.add_column( 'vehicle', sa.Column('modele', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('motorisation', sa.VARCHAR(length=80), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('annee', sa.INTEGER(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('AC_vehicle', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('marque', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('puissance', postgresql.DOUBLE_PRECISION(precision=53), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('telepeage', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('luxary', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('immatriculation', sa.VARCHAR(length=80), autoincrement=False, nullable=False)) op.add_column( 'vehicle', sa.Column('pmr', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('conventionne', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.add_column( 'vehicle', sa.Column('snv', sa.BOOLEAN(), autoincrement=False, nullable=True)) op.drop_column('vehicle', 'tablet') op.drop_column('vehicle', 'special_need_vehicle') op.drop_column('vehicle', 'model_year') op.drop_column('vehicle', 'model') op.drop_column('vehicle', 'luxury') op.drop_column('vehicle', 'licence_plate') op.drop_column('vehicle', 'horse_power') op.drop_column('vehicle', 'engine') op.drop_column('vehicle', 'electronic_toll') op.drop_column('vehicle', 'cpam_conventionne') op.drop_column('vehicle', 'constructor') op.drop_column('vehicle', 'air_con') op.add_column( 'driver', sa.Column('prenom', sa.VARCHAR(length=255), autoincrement=False, nullable=False)) op.add_column( 'driver', sa.Column('date_naissance', sa.DATE(), autoincrement=False, nullable=True)) op.add_column( 'driver', sa.Column('carte_pro', sa.VARCHAR(), autoincrement=False, nullable=False)) op.add_column( 'driver', sa.Column('nom', sa.VARCHAR(length=255), autoincrement=False, nullable=False)) op.drop_column('driver', 'professional_licence') op.drop_column('driver', 'last_name') op.drop_column('driver', 'first_name') op.drop_column('driver', 'birth_date') op.add_column( 'ADS', sa.Column('nom_societe', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.add_column( 'ADS', sa.Column('artisan', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) owner_type_enum.drop(op.get_bind()) op.add_column( 'ADS', sa.Column('personne', sa.VARCHAR(length=255), autoincrement=False, nullable=True)) op.alter_column('ADS', 'numero', existing_type=sa.INTEGER(), nullable=True) op.alter_column('ADS', 'added_via', existing_type=postgresql.ENUM('form', 'api', name='via'), nullable=True) op.drop_column('ADS', 'owner_type') op.drop_column('ADS', 'owner_name') op.drop_column('ADS', 'category')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('users', sa.Column('is_linked', sa.BOOLEAN(), nullable=True)) op.drop_column('users', 'notify')
def downgrade(): ### commands auto generated by Alembic - please adjust! ### op.add_column('release_monitor', sa.Column('torrent_cached', sa.BOOLEAN(), nullable=True))
def upgrade(): logger.info('better model description, adjustements to models') op.alter_column('article', 'feed_id', existing_type=sa.INTEGER(), nullable=False) op.alter_column('article', 'user_id', existing_type=sa.INTEGER(), nullable=False) logger.info('adding link_hash column') op.add_column('article', sa.Column('link_hash', sa.Binary(), nullable=True)) logger.info('updating link_hash values') op.get_bind().execute("""UPDATE article SET link_hash = digest(link, 'SHA1');""") logger.info('creating article indexes') op.create_index('ix_article_eid_cid_uid', 'article', ['user_id', 'category_id', 'entry_id'], unique=False) op.create_index('ix_article_uid_cid_linkh', 'article', ['user_id', 'category_id', 'link_hash'], unique=False) op.drop_index('article_uid_fid', table_name='article') op.create_index('ix_article_retrdate', 'article', ['retrieved_date'], unique=False) op.create_index('ix_article_uid_cid_cluid', 'article', ['user_id', 'category_id', 'cluster_id'], unique=False) op.create_index('ix_article_uid_cluid', 'article', ['user_id', 'cluster_id'], unique=False) op.create_index('ix_article_uid_fid_cluid', 'article', ['user_id', 'feed_id', 'cluster_id'], unique=False) op.drop_constraint('article_user_id_fkey', 'article', type_='foreignkey') op.drop_constraint('article_feed_id_fkey', 'article', type_='foreignkey') op.drop_constraint('article_category_id_fkey', 'article', type_='foreignkey') logger.info('creating article FK') op.create_foreign_key(None, 'article', 'user', ['user_id'], ['id'], ondelete='CASCADE') op.create_foreign_key(None, 'article', 'category', ['category_id'], ['id'], ondelete='CASCADE') op.create_foreign_key(None, 'article', 'feed', ['feed_id'], ['id'], ondelete='CASCADE') logger.info('updating category table') op.alter_column('category', 'user_id', existing_type=sa.INTEGER(), nullable=False) op.create_index('ix_category_uid', 'category', ['user_id'], unique=False) op.drop_constraint('category_user_id_fkey', 'category', type_='foreignkey') op.create_foreign_key(None, 'category', 'user', ['user_id'], ['id'], ondelete='CASCADE') logger.info('updating cluster table') op.alter_column('cluster', 'user_id', existing_type=sa.INTEGER(), nullable=False) logger.info('creating cluster index') op.create_index('ix_cluster_liked_uid_date', 'cluster', ['liked', 'user_id', sa.text('main_date DESC NULLS LAST')], unique=False) op.create_index('ix_cluster_read_uid_date', 'cluster', ['read', 'user_id', sa.text('main_date DESC NULLS LAST')], unique=False) op.create_index( 'ix_cluster_uid_date', 'cluster', ['user_id', sa.text('main_date DESC NULLS LAST')], unique=False) op.create_index( 'ix_cluster_martid', 'cluster', ['user_id', sa.text('main_article_id DESC NULLS FIRST')], unique=False) op.drop_constraint('cluster_user_id_fkey', 'cluster', type_='foreignkey') op.create_foreign_key(None, 'cluster', 'user', ['user_id'], ['id'], ondelete='CASCADE') logger.info('updating feed table') op.alter_column('feed', 'cache_support_a_im', existing_type=sa.BOOLEAN(), nullable=True, existing_server_default=sa.text('false')) op.alter_column('feed', 'user_id', existing_type=sa.INTEGER(), nullable=False) op.create_index('ix_feed_uid', 'feed', ['user_id'], unique=False) op.create_index('ix_feed_uid_cid', 'feed', ['user_id', 'category_id'], unique=False) op.drop_constraint('feed_category_id_fkey', 'feed', type_='foreignkey') op.drop_constraint('feed_user_id_fkey', 'feed', type_='foreignkey') op.create_foreign_key(None, 'feed', 'category', ['category_id'], ['id'], ondelete='CASCADE') op.create_foreign_key(None, 'feed', 'user', ['user_id'], ['id'], ondelete='CASCADE')
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.create_table( 'Artist', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Artist_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('genres', 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('website', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('seeking_venue', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('seeking_description', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='Artist_pkey'), postgresql_ignore_search_path=False) op.create_table( 'Venue', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Venue_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('genres', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('address', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('city', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('state', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('phone', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('website', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('facebook_link', sa.VARCHAR(length=120), autoincrement=False, nullable=True), sa.Column('seeking_talent', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('seeking_description', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('image_link', sa.VARCHAR(length=500), autoincrement=False, nullable=True), sa.Column('past_shows', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('upcoming_shows', sa.VARCHAR(), autoincrement=False, nullable=True), sa.Column('past_shows_count', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('upcoming_shows_count', sa.INTEGER(), autoincrement=False, nullable=True), sa.PrimaryKeyConstraint('id', name='Venue_pkey'), postgresql_ignore_search_path=False) op.create_table( 'testtable', sa.Column('string', sa.VARCHAR(length=120), autoincrement=False, nullable=True)) op.create_table( 'Show', sa.Column( 'id', sa.INTEGER(), server_default=sa.text('nextval(\'"Show_id_seq"\'::regclass)'), autoincrement=True, nullable=False), sa.Column('start_time', postgresql.TIMESTAMP(), autoincrement=False, nullable=True), sa.Column('venue_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.Column('artist_id', sa.INTEGER(), autoincrement=False, nullable=False), sa.ForeignKeyConstraint(['artist_id'], ['Artist.id'], name='Show_artist_id_fkey', ondelete='CASCADE'), sa.ForeignKeyConstraint(['venue_id'], ['Venue.id'], name='Show_venue_id_fkey', ondelete='CASCADE'), sa.PrimaryKeyConstraint('id', name='Show_pkey')) op.drop_table('venue') op.drop_table('artist')
def upgrade(): op.create_table( 'contacts', sa.Column('url', sa.VARCHAR(length=255), autoincrement=False, nullable=False), sa.Column('account_balance', sa.NUMERIC(precision=10, scale=2), autoincrement=False, nullable=True), sa.Column('address1', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('address2', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('address3', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('billing_email', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('charge_sales_tax', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('contact_name_on_invoices', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('country', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('email', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('first_name', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('is_deletable', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('last_name', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('locale', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('mobile', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('phone_number', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('organisation_name', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('postcode', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('region', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('status', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('sales_tax_registration_number', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('town', sa.VARCHAR(length=255), autoincrement=False, nullable=True), sa.Column('uses_contact_invoice_sequence', sa.BOOLEAN(), autoincrement=False, nullable=True), sa.Column('active_projects_count', sa.INTEGER(), autoincrement=False, nullable=True), sa.Column('created_at', sa.DateTime(), nullable=True), sa.Column('updated_at', sa.DateTime(), nullable=True), sa.PrimaryKeyConstraint('url', name=u'pk_contacts'))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.add_column('message', sa.Column('read_status', sa.BOOLEAN(), nullable=True))
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### with op.batch_alter_table('content__viewed', schema=None) as batch_op: batch_op.add_column(sa.Column('viewed', sa.BOOLEAN(), nullable=True))
def upgrade(): op.execute('UPDATE news_flash SET accident = false WHERE accident is null'); op.alter_column('news_flash', 'accident', existing_type=sa.BOOLEAN(), nullable=False)
def downgrade(): # ### commands auto generated by Alembic - please adjust! ### op.alter_column('protocols', 'done', existing_type=sa.BOOLEAN(), nullable=True)