Esempio n. 1
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('polygonpoint',
                    sa.Column('pgp_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=True,
                              nullable=False),
                    sa.Column('latitude', mysql.FLOAT(), nullable=True),
                    sa.Column('longitude', mysql.FLOAT(), nullable=True),
                    sa.Column('polygon_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.ForeignKeyConstraint(['polygon_id'],
                                            ['polygon.poly_id'],
                                            name='polygonpoint_ibfk_1'),
                    sa.PrimaryKeyConstraint('pgp_id'),
                    mysql_default_charset='utf8mb4',
                    mysql_engine='InnoDB')
    op.create_table('polygon',
                    sa.Column('poly_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=True,
                              nullable=False),
                    sa.Column('fill_color',
                              mysql.VARCHAR(length=10),
                              nullable=True),
                    sa.Column('gtw_id',
                              mysql.VARCHAR(length=80),
                              nullable=True),
                    sa.ForeignKeyConstraint(['gtw_id'], ['gateway.gtw_id'],
                                            name='polygon_ibfk_1'),
                    sa.PrimaryKeyConstraint('poly_id'),
                    mysql_default_charset='utf8mb4',
                    mysql_engine='InnoDB')
Esempio n. 2
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('name', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('admin', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
    sa.Column('email', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('email_verified', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
    sa.Column('account_status', mysql.VARCHAR(length=20), nullable=True),
    sa.Column('password_hash', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('password', mysql.VARCHAR(length=50), nullable=False),
    sa.Column('register_source', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('register_datetime', mysql.FLOAT(), nullable=True),
    sa.Column('service_starttime', mysql.FLOAT(), nullable=True),
    sa.Column('service_endtime', mysql.FLOAT(), nullable=True),
    sa.Column('token', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('usergroup_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('thunderservice_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('last_login_datetime', mysql.FLOAT(), nullable=True),
    sa.Column('last_login_ipaddress', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('mentor', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
    sa.Column('individual_coupon', mysql.VARCHAR(length=50), nullable=True),
    sa.Column('affiliate', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='utf8',
    mysql_engine='InnoDB'
    )
    op.create_index('email', 'user', ['email'], unique=True)
    op.drop_table('users')
Esempio n. 3
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('services',
    sa.Column('id', mysql.INTEGER(display_width=11, unsigned=True), autoincrement=True, nullable=False),
    sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
    sa.Column('updated_at', mysql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), nullable=False),
    sa.Column('name', mysql.VARCHAR(length=255), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    mysql_charset='utf8mb4',
    mysql_collate='utf8mb4_unicode_ci',
    mysql_engine='InnoDB'
    )
    op.create_table('users',
    sa.Column('id', mysql.INTEGER(display_width=11, unsigned=True), autoincrement=True, nullable=False),
    sa.Column('created_at', mysql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP'), nullable=False),
    sa.Column('updated_at', mysql.TIMESTAMP(), server_default=sa.text('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'), nullable=False),
    sa.Column('user_name', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('password', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('first_name', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('last_name', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('birthday', mysql.VARCHAR(length=255), nullable=True),
    sa.Column('phone', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('address', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('longitude', mysql.FLOAT(), nullable=True),
    sa.Column('latitude', mysql.FLOAT(), nullable=True),
    sa.Column('language', mysql.VARCHAR(length=255), nullable=False),
    sa.Column('is_guide', sa.BOOLEAN(), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    mysql_charset='utf8mb4',
    mysql_collate='utf8mb4_unicode_ci',
    mysql_engine='InnoDB'
    )
Esempio n. 4
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('blacklist_tokens',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('token', sa.String(length=500), nullable=False),
    sa.Column('blacklisted_on', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_blacklist_tokens_token'), 'blacklist_tokens', ['token'], unique=True)
    op.create_table('movies',
    sa.Column('id', models.GUID(length=32), nullable=False),
    sa.Column('name', sa.String(length=80), nullable=False),
    sa.Column('director', sa.String(length=80), nullable=False),
    sa.Column('popularity', mysql.FLOAT(precision=10, scale=1), nullable=True),
    sa.Column('genre', sa.Text(), nullable=False),
    sa.Column('imdb_score', mysql.FLOAT(precision=10, scale=1), nullable=True),
    sa.Column('views', sa.Integer(), nullable=True),
    sa.Column('created_by', models.GUID(length=32), nullable=True),
    sa.Column('updated_by', models.GUID(length=32), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['created_by'], ['admin_users.id'], ),
    sa.ForeignKeyConstraint(['updated_by'], ['admin_users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_movies_director'), 'movies', ['director'], unique=False)
    op.create_index(op.f('ix_movies_name'), 'movies', ['name'], unique=False)
Esempio n. 5
0
def upgrade():
    op.create_table('etablissements',
        sa.Column('siret', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=False),
        sa.Column('raisonsociale', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('enseigne', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('codenaf', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('trancheeffectif', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('numerorue', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('libellerue', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('codepostal', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=11), nullable=True),
        sa.Column('tel', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('email', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('website', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('flag_alternance', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
        sa.Column('flag_junior', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
        sa.Column('flag_senior', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
        sa.Column('flag_handicap', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
        sa.Column('has_multi_geolocations', mysql.TINYINT(display_width=1), autoincrement=False, nullable=False),
        sa.Column('codecommune', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('coordinates_x', mysql.FLOAT(), nullable=True),
        sa.Column('coordinates_y', mysql.FLOAT(), nullable=True),
        sa.Column('departement', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=11), nullable=True),
        sa.Column('score', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint('siret'),
        mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB'
    )
Esempio n. 6
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'restaurant_info',
        sa.Column('lat', mysql.FLOAT(precision=16, scale=16), nullable=True))
    op.add_column(
        'restaurant_info',
        sa.Column('lon', mysql.FLOAT(precision=16, scale=16), nullable=True))
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('Supplizer',
                    'SUname',
                    existing_type=mysql.VARCHAR(length=16),
                    nullable=False)
    op.create_table('magic_box_join',
                    sa.Column('isdelete',
                              mysql.TINYINT(display_width=1),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('createtime', mysql.DATETIME(), nullable=True),
                    sa.Column('updatetime', mysql.DATETIME(), nullable=True),
                    sa.Column('MBJid',
                              mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('USid', mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('MABid',
                              mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('MBJprice', mysql.FLOAT(), nullable=False),
                    sa.PrimaryKeyConstraint('MBJid'),
                    mysql_default_charset='utf8',
                    mysql_engine='InnoDB')
    op.create_table('magix_box_open',
                    sa.Column('isdelete',
                              mysql.TINYINT(display_width=1),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('createtime', mysql.DATETIME(), nullable=True),
                    sa.Column('updatetime', mysql.DATETIME(), nullable=True),
                    sa.Column('MBOid',
                              mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('USid', mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('MBJid',
                              mysql.VARCHAR(length=64),
                              nullable=False),
                    sa.Column('MBOgear',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=False),
                    sa.Column('MBOresult', mysql.FLOAT(), nullable=False),
                    sa.Column('MBOprice', mysql.FLOAT(), nullable=False),
                    sa.Column('MBOhasShare',
                              mysql.TINYINT(display_width=1),
                              autoincrement=False,
                              nullable=True),
                    sa.PrimaryKeyConstraint('MBOid'),
                    mysql_default_charset='utf8',
                    mysql_engine='InnoDB')
    op.drop_table('UserSalesvolume')
    op.drop_table('UserInvitation')
    op.drop_table('MagixBoxOpen')
    op.drop_table('MagicBoxJoin')
    op.drop_table('FreshManFirst')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_index('user_id_UNIQUE', 'vote', ['user_id'], unique=True)
    op.create_index('event_id_UNIQUE', 'vote', ['event_id'], unique=True)
    op.add_column('event', sa.Column('longitude', mysql.FLOAT(),
                                     nullable=True))
    op.add_column('event', sa.Column('latitude', mysql.FLOAT(), nullable=True))
    op.drop_column('event', 'long')
    op.drop_column('event', 'lat')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'business',
        sa.Column('current_process_used_time', mysql.FLOAT(), nullable=True))
    op.add_column('business',
                  sa.Column('used_time', mysql.FLOAT(), nullable=True))
    op.drop_column('business', 'takan_used_time')
    op.drop_column('business', 'current_process_start_time')
Esempio n. 10
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('DiskReadProfile',
                  sa.Column('format', mysql.VARCHAR(length=20), nullable=True))
    op.add_column('DiskReadProfile',
                  sa.Column('seq_read_ms', mysql.FLOAT(), nullable=True))
    op.add_column('DiskReadProfile',
                  sa.Column('rand_read_ms', mysql.FLOAT(), nullable=True))
    op.drop_column('DiskReadProfile', 'disk')
Esempio n. 11
0
def upgrade():
    op.create_table(
        'perf_importer_cycle_infos',
        sa.Column('id', mysql.BIGINT(display_width=20), autoincrement=True, nullable=False),
        sa.Column('execution_date', mysql.DATETIME(), nullable=True),
        sa.Column('prediction_start_date', mysql.DATETIME(), nullable=True),
        sa.Column('prediction_end_date', mysql.DATETIME(), nullable=True),
        sa.Column('file_name', mysql.TEXT(collation='utf8mb4_unicode_ci'), nullable=True),
        sa.Column('computed', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
        sa.Column('on_google_sheets', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
        sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB'
    )
    op.create_table(
        'perf_division_per_rome',
        sa.Column('id', mysql.BIGINT(display_width=20), autoincrement=True, nullable=False),
        sa.Column('importer_cycle_infos_id', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True),
        sa.Column('codenaf', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=8), nullable=False),
        sa.Column('coderome', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=8), nullable=False),
        sa.Column('threshold_lbb', mysql.FLOAT(), nullable=True),
        sa.Column('threshold_lba', mysql.FLOAT(), nullable=True),
        sa.Column('nb_bonne_boites_lbb', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('nb_bonne_boites_lba', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.ForeignKeyConstraint(['importer_cycle_infos_id'], ['perf_importer_cycle_infos.id'], name='perf_division_per_rome_ibfk_1', ondelete='SET NULL'),
        sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB'
    )
    op.create_table(
        'perf_prediction_and_effective_hirings',
        sa.Column('id', mysql.BIGINT(display_width=20), autoincrement=True, nullable=False),
        sa.Column('importer_cycle_infos_id', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True),
        sa.Column('siret', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('codenaf', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=8), nullable=True),
        sa.Column('codecommune', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('codepostal', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=8), nullable=True),
        sa.Column('departement', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=8), nullable=True),
        sa.Column('raisonsociale', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('enseigne', mysql.VARCHAR(collation='utf8mb4_unicode_ci', length=191), nullable=True),
        sa.Column('lbb_nb_predicted_hirings', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('lba_nb_predicted_hirings', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('lbb_nb_predicted_hirings_score', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('lba_nb_predicted_hirings_score', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('lbb_nb_effective_hirings', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('lba_nb_effective_hirings', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
        sa.Column('is_a_bonne_boite', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
        sa.Column('is_a_bonne_alternance', mysql.TINYINT(display_width=1), autoincrement=False, nullable=True),
        sa.ForeignKeyConstraint(['importer_cycle_infos_id'], ['perf_importer_cycle_infos.id'], name='perf_prediction_and_effective_hirings_ibfk_1', ondelete='SET NULL'),
        sa.PrimaryKeyConstraint('id'),
        mysql_collate='utf8mb4_unicode_ci',
        mysql_default_charset='utf8mb4',
        mysql_engine='InnoDB'
    )
Esempio n. 12
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('roundup_donation', 'total_amount',
               existing_type=sa.Integer(),
               type_=mysql.FLOAT(),
               existing_nullable=False)
    op.alter_column('roundup_donation', 'base_donation_amt',
               existing_type=sa.Integer(),
               type_=mysql.FLOAT(),
               existing_nullable=False)
Esempio n. 13
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('users', sa.Column('sticky_lon',
                                     mysql.FLOAT(),
                                     nullable=True))
    op.add_column('users', sa.Column('sticky_lat',
                                     mysql.FLOAT(),
                                     nullable=True))
    op.drop_column('survey_responses', 'lon')
    op.drop_column('survey_responses', 'lat')
Esempio n. 14
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('event', 'lat',
               existing_type=mysql.FLOAT(),
               type_=sa.Numeric(precision=11, scale=8),
               existing_nullable=True)
    op.alter_column('event', 'long',
               existing_type=mysql.FLOAT(),
               type_=sa.Numeric(precision=11, scale=8),
               existing_nullable=True)
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('question',
                    'points_correct',
                    existing_type=mysql.FLOAT(display_width=11),
                    nullable=False,
                    default=0)
    op.alter_column('question',
                    'points_wrong',
                    existing_type=mysql.FLOAT(display_width=11),
                    nullable=False,
                    default=0)
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('message',
                    'longitude',
                    existing_type=sa.String(length=64),
                    type_=mysql.FLOAT(),
                    existing_nullable=True)
    op.alter_column('message',
                    'latitude',
                    existing_type=sa.String(length=64),
                    type_=mysql.FLOAT(),
                    existing_nullable=True)
Esempio n. 17
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        u'onchain_task',
        sa.Column('method_name', mysql.VARCHAR(length=255), nullable=True))
    op.drop_column(u'onchain_task', 'contract_method')
    op.add_column(
        u'match', sa.Column('source', mysql.VARCHAR(length=256),
                            nullable=True))
    op.drop_constraint(None, 'match', type_='foreignkey')
    op.drop_constraint(None, 'match', type_='foreignkey')
    op.drop_column(u'match', 'source_id')
    op.drop_column(u'match', 'category_id')
    op.create_table('history',
                    sa.Column('id',
                              mysql.INTEGER(display_width=11),
                              nullable=False),
                    sa.Column('date_created', mysql.DATETIME(), nullable=True),
                    sa.Column('date_modified', mysql.DATETIME(),
                              nullable=True),
                    sa.Column('deleted',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('shaker_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('handshake_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('maker_amount', mysql.FLOAT(), nullable=True),
                    sa.Column('maker_odds', mysql.FLOAT(), nullable=True),
                    sa.Column('shaker_amount', mysql.FLOAT(), nullable=True),
                    sa.Column('shaker_odds', mysql.FLOAT(), nullable=True),
                    sa.Column('modified_user_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('created_user_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.ForeignKeyConstraint(['created_user_id'], [u'user.id'],
                                            name=u'history_ibfk_1'),
                    sa.ForeignKeyConstraint(['modified_user_id'], [u'user.id'],
                                            name=u'history_ibfk_2'),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_default_charset=u'utf8',
                    mysql_engine=u'InnoDB')
    op.drop_table('source')
    op.drop_table('category')