コード例 #1
0
ファイル: 4e186245e39b_.py プロジェクト: xxTeDYxx/get5-web
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('tAudit',
                    sa.Column('id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=False),
                    sa.Column('user_id',
                              mysql.INTEGER(display_width=11),
                              autoincrement=False,
                              nullable=True),
                    sa.Column('name', mysql.VARCHAR(length=40), nullable=True),
                    sa.Column('flag', mysql.VARCHAR(length=4), nullable=True),
                    sa.Column('logo', mysql.VARCHAR(length=40), nullable=True),
                    sa.Column('old_auths', sa.BLOB(), nullable=True),
                    sa.Column('new_auths', sa.BLOB(), nullable=True),
                    sa.Column(
                        'date_changed',
                        mysql.TIMESTAMP(),
                        server_default=sa.text(
                            u'CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'),
                        nullable=False),
                    mysql_default_charset=u'latin1',
                    mysql_engine=u'InnoDB')
    op.execute(
        "CREATE TRIGGER team_audit AFTER UPDATE ON team FOR EACH ROW BEGIN INSERT INTO tAudit values(OLD.id, OLD.user_id, OLD.`name`, OLD.flag, OLD.logo, OLD.auths, NEW.auths, CURRENT_TIMESTAMP); END;"
    )
コード例 #2
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'event',
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('name', sa.String(length=255), nullable=False),
        sa.Column('initial_number_of_tickets', sa.Integer(), nullable=False),
        sa.Column('additional_number_of_tickets', sa.Integer(), nullable=True),
        sa.Column('guid', sa.BLOB(), nullable=False),
        sa.Column('author_id', sa.Integer(), nullable=True),
        sa.Column('date_created_utc', sa.DateTime(), nullable=False),
        sa.ForeignKeyConstraint(
            ['author_id'],
            ['users.id'],
        ), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('guid'))
    op.create_table(
        'ticket',
        sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
        sa.Column('event_id', sa.Integer(), nullable=True),
        sa.Column('guid', sa.BLOB(), nullable=False),
        sa.Column('is_redeemed', sa.Boolean(), nullable=True),
        sa.Column('date_created_utc', sa.DateTime(), nullable=False),
        sa.Column('author_id', sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ['author_id'],
            ['users.id'],
        ), sa.ForeignKeyConstraint(
            ['event_id'],
            ['event.id'],
        ), sa.PrimaryKeyConstraint('id'))
コード例 #3
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###

    with op.batch_alter_table('reviews', schema=None) as batch_op:
        batch_op.alter_column('custom_question_answer',
                              existing_type=JsonObject,
                              type_=sa.BLOB(),
                              existing_nullable=True)

    with op.batch_alter_table('registrations', schema=None) as batch_op:
        batch_op.alter_column('private_question',
                              existing_type=JsonObject,
                              type_=sa.BLOB(),
                              existing_nullable=True)

    with op.batch_alter_table('form_configuration', schema=None) as batch_op:
        batch_op.alter_column('configuration',
                              existing_type=JsonObject,
                              type_=sa.BLOB(),
                              existing_nullable=True)
        batch_op.alter_column('common_questions',
                              existing_type=JsonObject,
                              type_=sa.BLOB(),
                              existing_nullable=True)

    with op.batch_alter_table('conferences', schema=None) as batch_op:
        batch_op.alter_column('review_questions',
                              existing_type=JsonObject,
                              type_=sa.BLOB(),
                              existing_nullable=True)
コード例 #4
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('apscheduler_jobs',
                    sa.Column('id', mysql.VARCHAR(length=191), nullable=False),
                    sa.Column('next_run_time',
                              mysql.DOUBLE(asdecimal=True),
                              nullable=True),
                    sa.Column('job_state', sa.BLOB(), nullable=False),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_collate='utf8mb4_0900_ai_ci',
                    mysql_default_charset='utf8mb4',
                    mysql_engine='InnoDB')
    op.create_index('ix_apscheduler_jobs_next_run_time',
                    'apscheduler_jobs', ['next_run_time'],
                    unique=False)
    op.create_table('sessions',
                    sa.Column('id',
                              mysql.INTEGER(),
                              autoincrement=True,
                              nullable=False),
                    sa.Column('session_id',
                              mysql.VARCHAR(length=255),
                              nullable=True),
                    sa.Column('data', sa.BLOB(), nullable=True),
                    sa.Column('expiry', mysql.DATETIME(), nullable=True),
                    sa.PrimaryKeyConstraint('id'),
                    mysql_collate='utf8mb4_0900_ai_ci',
                    mysql_default_charset='utf8mb4',
                    mysql_engine='InnoDB')
    op.create_index('session_id', 'sessions', ['session_id'], unique=True)
コード例 #5
0
def upgrade():
    with op.batch_alter_table('conferences', schema=None) as batch_op:
        batch_op.alter_column('review_questions',
                              existing_type=sa.BLOB(),
                              type_=JsonObject,
                              existing_nullable=True)

    with op.batch_alter_table('form_configuration', schema=None) as batch_op:
        batch_op.alter_column('common_questions',
                              existing_type=sa.BLOB(),
                              type_=JsonObject,
                              existing_nullable=True)
        batch_op.alter_column('configuration',
                              existing_type=sa.BLOB(),
                              type_=JsonObject,
                              existing_nullable=True)

    with op.batch_alter_table('registrations', schema=None) as batch_op:
        batch_op.alter_column('private_question',
                              existing_type=sa.BLOB(),
                              type_=JsonObject,
                              existing_nullable=True)

    with op.batch_alter_table('reviews', schema=None) as batch_op:
        batch_op.alter_column('custom_question_answer',
                              existing_type=sa.BLOB(),
                              type_=JsonObject,
                              existing_nullable=True)
コード例 #6
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('testjob', 'caseorder')
    op.create_table('test',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('jobName', sa.VARCHAR(length=64), nullable=True),
    sa.Column('jobType', sa.INTEGER(), nullable=True),
    sa.Column('relateCases', sa.BLOB(), nullable=True),
    sa.Column('relateDevices', sa.BLOB(), nullable=True),
    sa.Column('testapk', sa.VARCHAR(length=512), nullable=True),
    sa.Column('appPackage', sa.VARCHAR(length=64), nullable=True),
    sa.Column('appActivity', sa.VARCHAR(length=64), nullable=True),
    sa.Column('result', sa.INTEGER(), nullable=True),
    sa.Column('reportID', sa.INTEGER(), nullable=True),
    sa.Column('status', sa.INTEGER(), nullable=True),
    sa.Column('createdtime', sa.DATETIME(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('user',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('email', sa.VARCHAR(length=64), nullable=True),
    sa.Column('username', sa.VARCHAR(length=64), nullable=True),
    sa.Column('password', sa.VARCHAR(length=128), nullable=True),
    sa.Column('createdtime', sa.DATETIME(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
コード例 #7
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('keyrotation', schema=None) as batch_op:
        batch_op.add_column(sa.Column('oxeleven_token_iv', sa.BLOB(), nullable=True))
        batch_op.add_column(sa.Column('oxeleven_token', sa.BLOB(), nullable=True))
        batch_op.add_column(sa.Column('oxeleven_url', sa.VARCHAR(length=255), nullable=True))
        batch_op.add_column(sa.Column('oxeleven_token_key', sa.BLOB(), nullable=True))
        batch_op.drop_column('enabled')
コード例 #8
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('model', sa.Column('pred_histogram',
                                     sa.BLOB(),
                                     nullable=True))
    op.add_column('model', sa.Column('true_histogram',
                                     sa.BLOB(),
                                     nullable=True))
def upgrade():
    op.alter_column('facts',
                    'value',
                    type_=sa.BLOB(length=4294967295),
                    nullable=False)
    op.alter_column('violations',
                    'value',
                    type_=sa.BLOB(length=4294967295),
                    nullable=False)
コード例 #10
0
ファイル: 3b20d207b79a_.py プロジェクト: leon0707/conf-panda
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('registrations', schema=None) as batch_op:
        batch_op.add_column(
            sa.Column('deleted_private_question', sa.BLOB(), nullable=True))

    with op.batch_alter_table('conferences', schema=None) as batch_op:
        batch_op.add_column(
            sa.Column('deleted_review_questions', sa.BLOB(), nullable=True))
コード例 #11
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table(u'registrations', schema=None) as batch_op:
        batch_op.add_column(sa.Column('payout', sa.BLOB(), nullable=True))

    with op.batch_alter_table(u'form_configuration', schema=None) as batch_op:
        batch_op.add_column(
            sa.Column('payout_scheme', sa.BLOB(), nullable=True))

    op.drop_table('payouts')
コード例 #12
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('merchant_raw',
                    'storage',
                    existing_type=sa.String(length=10000),
                    type_=sa.BLOB(),
                    existing_nullable=True)
    op.create_table('company_raw_data',
                    sa.Column('id', sa.INTEGER(), nullable=False),
                    sa.Column('keyNo', sa.VARCHAR(length=140), nullable=True),
                    sa.Column('storage', sa.BLOB(), nullable=True),
                    sa.PrimaryKeyConstraint('id'))
コード例 #13
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('merchant_raw',
                    'storage',
                    existing_type=sa.String(length=10000),
                    type_=sa.BLOB(),
                    existing_nullable=True)
    op.alter_column('company_raw_data',
                    'storage',
                    existing_type=sa.String(length=10000),
                    type_=sa.BLOB(),
                    existing_nullable=True)
コード例 #14
0
ファイル: aa2d0841727e_.py プロジェクト: Wo-Ki/aliProject
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('production', sa.Column('image1', sa.BLOB(), nullable=False))
    op.add_column('production', sa.Column('image2', sa.BLOB(), nullable=True))
    op.add_column('production', sa.Column('image3', sa.BLOB(), nullable=True))
    op.add_column('production', sa.Column('image4', sa.BLOB(), nullable=True))
    op.add_column('production', sa.Column('image5', sa.BLOB(), nullable=True))
    op.drop_column('production', 'province')
    op.drop_column('production', 'insertPic_4')
    op.drop_column('production', 'insertPic_3')
    op.drop_column('production', 'insertPic_2')
    op.drop_column('production', 'insertPic_1')
    op.drop_column('production', 'insertPic_0')
コード例 #15
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('package_versions', schema=None) as batch_op:
        batch_op.alter_column(
            'size',
            existing_type=sa.BigInteger(),
            type_=sa.INTEGER(),
            existing_nullable=True,
        )

    with op.batch_alter_table('channels', schema=None) as batch_op:
        batch_op.alter_column(
            'size_limit',
            existing_type=sa.BigInteger(),
            type_=sa.INTEGER(),
            existing_nullable=True,
        )
        batch_op.alter_column(
            'size',
            existing_type=sa.BigInteger(),
            type_=sa.INTEGER(),
            existing_nullable=True,
        )

    op.create_table(
        'repodata_signing_keys',
        sa.Column('id', sa.BLOB(), nullable=False),
        sa.Column('private_key', sa.VARCHAR(), nullable=True),
        sa.Column(
            'time_created',
            sa.DATE(),
            server_default=sa.text('(CURRENT_TIMESTAMP)'),
            nullable=False,
        ),
        sa.Column('user_id', sa.BLOB(), nullable=True),
        sa.Column('channel_name', sa.VARCHAR(), nullable=True),
        sa.ForeignKeyConstraint(
            ['channel_name'],
            ['channels.name'],
        ),
        sa.ForeignKeyConstraint(
            ['user_id'],
            ['users.id'],
        ),
        sa.PrimaryKeyConstraint('id'),
    )
    op.drop_table('delegations_keys')
    op.drop_table('signing_keys')
    op.drop_table('role_delegations')
    op.drop_table('content_trust_roles')
コード例 #16
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'task', sa.Column('id', sa.String(length=36), nullable=False),
        sa.Column('mode', sa.String(length=36), nullable=True),
        sa.Column('description', sa.String(length=128), nullable=True),
        sa.Column('laser_freq', sa.Integer(), nullable=True),
        sa.Column('duration', sa.Integer(), nullable=True),
        sa.Column('resolution', sa.Float(), nullable=True),
        sa.Column('bin_length', sa.Integer(), nullable=True),
        sa.Column('start_time', sa.DateTime(), nullable=True),
        sa.Column('end_time', sa.DateTime(), nullable=True),
        sa.Column('data_num', sa.Integer(), nullable=True),
        sa.Column('ver_start_angle', sa.Float(), nullable=True),
        sa.Column('ver_end_angle', sa.Float(), nullable=True),
        sa.Column('ver_step', sa.Float(), nullable=True),
        sa.Column('hor_start_angle', sa.Float(), nullable=True),
        sa.Column('hor_end_angle', sa.Float(), nullable=True),
        sa.Column('hor_step', sa.Float(), nullable=True),
        sa.Column('complete', sa.Boolean(), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_task_mode'), 'task', ['mode'], unique=False)
    op.create_table(
        'user', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=64), nullable=True),
        sa.Column('password_hash', sa.String(length=128), nullable=True),
        sa.Column('last_seen', sa.DateTime(), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_user_username'),
                    'user', ['username'],
                    unique=True)
    op.create_table('task_data', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('task_id', sa.String(length=36), nullable=True),
                    sa.Column('timestamp', sa.DateTime(), nullable=True),
                    sa.Column('longitude', sa.Float(), nullable=True),
                    sa.Column('latitude', sa.Float(), nullable=True),
                    sa.Column('altitude', sa.Float(), nullable=True),
                    sa.Column('ver_angle', sa.Float(), nullable=True),
                    sa.Column('hor_angle', sa.Float(), nullable=True),
                    sa.Column('raw_A', sa.BLOB(), nullable=True),
                    sa.Column('raw_B', sa.BLOB(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['task_id'],
                        ['task.id'],
                    ), sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_task_data_timestamp'),
                    'task_data', ['timestamp'],
                    unique=False)
コード例 #17
0
def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(u'ix_users_first_seen', table_name='users')
    op.drop_index(u'ix_subscription_expires_at', table_name='subscription')
    op.drop_index(u'ix_searches_created_at', table_name='searches')
    op.drop_index(u'ix_replays_state', table_name='replays')
    op.drop_index(u'ix_replays_replay_state', table_name='replays')
    op.drop_index(u'ix_replays_radiant_team_name', table_name='replays')
    op.drop_index(u'ix_replays_radiant_team_id', table_name='replays')
    op.drop_index(u'ix_replays_local_uri', table_name='replays')
    op.drop_index(u'ix_replays_league_id', table_name='replays')
    op.drop_index(u'ix_replays_gc_done_time', table_name='replays')
    op.drop_index(u'ix_replays_game_mode', table_name='replays')
    op.drop_index(u'ix_replays_dl_done_time', table_name='replays')
    op.drop_index(u'ix_replays_dire_team_name', table_name='replays')
    op.drop_index(u'ix_replays_dire_team_id', table_name='replays')
    op.drop_index(u'ix_replays_added_to_site_time', table_name='replays')
    op.drop_index(u'ix_replay_ratings_positive', table_name='replay_ratings')
    op.drop_index(u'ix_replay_players_hero_id', table_name='replay_players')
    op.drop_index(u'ix_replay_players_account_id', table_name='replay_players')
    op.drop_index(u'ix_replay_alias_updated_at', table_name='replay_alias')
    op.drop_index(u'ix_logs_resolved_by_user_id', table_name='logs')
    op.drop_index(u'ix_logs_level', table_name='logs')
    op.drop_index(u'ix_league_views_menu_order', table_name='league_views')
    op.drop_index(u'ix_league_views_league_id', table_name='league_views')
    op.alter_column('gc_workers',
                    'password',
                    existing_type=sa.BLOB(),
                    nullable=True)
    op.drop_index(u'ix_gc_jobs_type', table_name='gc_jobs')
    op.drop_index(u'ix_gc_jobs_timestamp', table_name='gc_jobs')
コード例 #18
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'user', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('token', sa.String(length=80), nullable=True),
        sa.Column('username', sa.String(length=64), nullable=True),
        sa.Column('email', sa.String(length=120), nullable=True),
        sa.Column('password_hash', sa.String(length=128), nullable=True),
        sa.Column('nome_bar', sa.String(length=120), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_nome_bar'),
                    'user', ['nome_bar'],
                    unique=True)
    op.create_index(op.f('ix_user_token'), 'user', ['token'], unique=True)
    op.create_index(op.f('ix_user_username'),
                    'user', ['username'],
                    unique=True)
    op.create_table(
        'food', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('nome', sa.String(length=120), nullable=True),
        sa.Column('image', sa.BLOB(), nullable=True),
        sa.Column('tipologia', sa.String(length=120), nullable=True),
        sa.Column('descrizione', sa.String(length=120), nullable=True),
        sa.Column('prezzo', sa.Integer(), nullable=True),
        sa.Column('sempre_attivo', sa.Boolean(), nullable=True),
        sa.Column('data', sa.DateTime(), nullable=True),
        sa.Column('nome_food', sa.String(length=120), nullable=True),
        sa.ForeignKeyConstraint(
            ['nome_food'],
            ['user.nome_bar'],
        ), sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_food_data'), 'food', ['data'], unique=False)
コード例 #19
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column(
        'apartment',
        sa.Column('front_plan_file', sa.VARCHAR(length=20), nullable=False))
    op.add_column('apartment',
                  sa.Column('clientSatisfaction', sa.INTEGER(), nullable=True))
    op.add_column('apartment',
                  sa.Column('front_plan_photo_data', sa.BLOB(), nullable=True))
    op.drop_constraint(None, 'apartment', type_='foreignkey')
    op.create_foreign_key(None, 'apartment', 'satisfaction',
                          ['clientSatisfaction'], ['id'])
    op.alter_column('apartment',
                    'love',
                    existing_type=sa.INTEGER(),
                    nullable=False)
    op.drop_column('apartment', 'floor_plan_photo_data')
    op.drop_column('apartment', 'floor_plan_file')
    op.drop_column('apartment', 'agent')
    op.add_column('agent', sa.Column('ssn', sa.INTEGER(), nullable=False))
    op.add_column('agent',
                  sa.Column('clientSatisfaction', sa.INTEGER(), nullable=True))
    op.add_column('agent', sa.Column('sacked', sa.BOOLEAN(), nullable=True))
    op.add_column('agent',
                  sa.Column('date_employed', sa.VARCHAR(), nullable=False))
    op.add_column('agent', sa.Column('dob', sa.VARCHAR(), nullable=False))
    op.create_foreign_key(None, 'agent', 'satisfaction',
                          ['clientSatisfaction'], ['id'])
    op.drop_column('agent', 'date_uploaded')
    op.create_table('satisfaction',
                    sa.Column('id', sa.INTEGER(), nullable=False),
                    sa.Column('rating', sa.INTEGER(), nullable=True),
                    sa.Column('sales', sa.INTEGER(), nullable=True),
                    sa.PrimaryKeyConstraint('id'))
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "userinfo",
        sa.Column(
            "id", mysql.INTEGER(display_width=11), autoincrement=False, nullable=False
        ),
        sa.Column("username", mysql.TEXT(), nullable=False),
        sa.Column("password", mysql.TEXT(), nullable=False),
        sa.Column("name", mysql.TEXT(), nullable=False),
        sa.Column("avatar", sa.BLOB(), nullable=False),
        sa.Column(
            "favorites",
            mysql.LONGTEXT(charset="utf8mb4", collation="utf8mb4_bin"),
            nullable=False,
        ),
        sa.Column(
            "history",
            mysql.LONGTEXT(charset="utf8mb4", collation="utf8mb4_bin"),
            nullable=False,
        ),
        mysql_default_charset="utf8",
        mysql_engine="InnoDB",
    )
    op.drop_index(op.f("ix_user_username"), table_name="user")
    op.drop_table("user")
コード例 #21
0
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('user_img',
                  sa.Column('name', mysql.VARCHAR(length=100), nullable=True))
    op.add_column('user_img', sa.Column('data', sa.BLOB(), nullable=True))
    op.drop_constraint(None, 'user_img', type_='foreignkey')
    op.drop_column('user_img', 'path')
コード例 #22
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'dpfcar', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('carnumber', sa.String(length=15), nullable=False),
        sa.Column('carnumber4', sa.String(length=4), nullable=False),
        sa.Column('caryear', sa.String(length=4), nullable=False),
        sa.Column('carkind', sa.String(length=10), nullable=False),
        sa.Column('create_date', sa.DateTime(), nullable=False),
        sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('carnumber'))
    op.create_table(
        'user', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('userid', sa.String(length=50), nullable=False),
        sa.Column('userpassword', sa.String(length=200), nullable=False),
        sa.Column('username', sa.String(length=100), nullable=False),
        sa.Column('usertel', sa.String(length=50), nullable=False),
        sa.Column('useremail', sa.String(length=120), nullable=False),
        sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('useremail'),
        sa.UniqueConstraint('userid'))
    op.create_table(
        'contact', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('dpfcar_id', sa.Integer(), nullable=True),
        sa.Column('user_id', sa.Integer(), nullable=True),
        sa.Column('ownername', sa.String(length=100), nullable=False),
        sa.Column('ownertel', sa.String(length=50), nullable=False),
        sa.Column('owneretc', sa.Text(), nullable=True),
        sa.Column('licenseimg', sa.BLOB(), nullable=True),
        sa.Column('create_date', sa.DateTime(), nullable=False),
        sa.Column('update_date', sa.DateTime(), nullable=True),
        sa.ForeignKeyConstraint(['dpfcar_id'], ['dpfcar.id'],
                                ondelete='CASCADE'),
        sa.ForeignKeyConstraint(['user_id'], ['user.id'], ondelete='CASCADE'),
        sa.PrimaryKeyConstraint('id'))
コード例 #23
0
def downgrade():
    op.add_column('user', sa.Column('bot_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False))
    op.create_foreign_key(u'user_ibfk_1', 'user', 'bot', ['bot_id'], ['id'])
    op.drop_constraint(None, 'platform', type_='foreignkey')
    op.drop_column('platform', 'name')
    op.drop_column('platform', 'account_id')
    op.add_column('broadcast', sa.Column('message', sa.BLOB(), nullable=False))
    op.drop_constraint(None, 'broadcast', type_='foreignkey')
    op.drop_constraint(None, 'broadcast', type_='foreignkey')
    op.alter_column('broadcast', 'scheduled_time',
               existing_type=mysql.DATETIME(),
               nullable=False)
    op.drop_column('broadcast', 'status')
    op.drop_column('broadcast', 'name')
    op.drop_column('broadcast', 'messages')
    op.drop_column('broadcast', 'bot_id')
    op.drop_column('broadcast', 'account_id')
    op.drop_constraint(None, 'bot', type_='foreignkey')
    op.drop_column('bot', 'staging')
    op.drop_column('bot', 'account_id')
    op.drop_constraint(None, 'account', type_='unique')
    op.drop_column('account', 'timezone')
    op.create_table('account_bot',
    sa.Column('account_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.Column('bot_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
    sa.ForeignKeyConstraint(['account_id'], [u'account.id'], name=u'account_bot_ibfk_1'),
    sa.ForeignKeyConstraint(['bot_id'], [u'bot.id'], name=u'account_bot_ibfk_2'),
    mysql_collate=u'utf8_unicode_ci',
    mysql_default_charset=u'utf8',
    mysql_engine=u'InnoDB'
    )
    op.drop_table('bot_def')
コード例 #24
0
ファイル: 095_secret_storage.py プロジェクト: wmv/inbox
def upgrade():
    # SECRETS TABLE:
    # Can just drop this, was't really used before
    op.drop_column('secret', 'acl_id')

    op.alter_column('secret',
                    'type',
                    type_=sa.Enum('password', 'token'),
                    existing_server_default=None,
                    existing_nullable=False)

    op.add_column(
        'secret',
        sa.Column('encryption_scheme',
                  sa.Integer(),
                  server_default='0',
                  nullable=False))
    op.add_column('secret', sa.Column('_secret', sa.BLOB(), nullable=False))

    # Account tables:
    # Don't need to change column types for password_id, refresh_token_id;
    # only add foreign key indices.
    op.create_foreign_key('genericaccount_ibfk_2', 'genericaccount', 'secret',
                          ['password_id'], ['id'])
    op.create_foreign_key('gmailaccount_ibfk_2', 'gmailaccount', 'secret',
                          ['refresh_token_id'], ['id'])
    op.create_foreign_key('outlookaccount_ibfk_2', 'outlookaccount', 'secret',
                          ['refresh_token_id'], ['id'])
コード例 #25
0
def downgrade():
    op.add_column('runs', sa.Column('command', sa.VARCHAR(), nullable=True))
    op.add_column('run_histories',
                  sa.Column('check_command', sa.BLOB(), nullable=True))
    op.drop_table('report_analysis_info')
    op.drop_table('run_history_analysis_info')
    op.drop_table('analysis_info')
コード例 #26
0
ファイル: 802c20ccb94d_.py プロジェクト: f0cker/crackq
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user') as batch_op:
        batch_op.alter_column('id',
                   existing_type=sqlalchemy_utils.types.uuid.UUIDType(),
                   type_=sa.NUMERIC(precision=16),
                   existing_nullable=False)
    with op.batch_alter_table('templates') as batch_op:
        batch_op.alter_column('id',
                   existing_type=sqlalchemy_utils.types.uuid.UUIDType(),
                   type_=sa.NUMERIC(precision=16),
                   existing_nullable=False)
    with op.batch_alter_table('tasks') as batch_op:
        batch_op.alter_column('id',
                   existing_type=sqlalchemy_utils.types.uuid.UUIDType(),
                   type_=sa.NUMERIC(precision=16),
                   existing_nullable=False)
    op.create_table('sessions',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('session_id', sa.VARCHAR(length=255), nullable=True),
    sa.Column('data', sa.BLOB(), nullable=True),
    sa.Column('expiry', sa.DATETIME(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('session_id')
    )
コード例 #27
0
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'aws_my_resources', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('key', sa.Unicode(length=20), nullable=False),
        sa.Column('value', sa.BLOB(length=16000000), nullable=False),
        sa.Column('date', sa.DateTime(), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.create_table(
        'aws_my_db_resources', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('key', sa.Unicode(length=20), nullable=False),
        sa.Column('value', sa.BLOB(length=16000000), nullable=False),
        sa.Column('date', sa.DateTime(), nullable=True),
        sa.PrimaryKeyConstraint('id'))
    op.drop_table('providers_comparison_aws')
    op.drop_table('amazon_rds_engine_comparison')
def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.alter_column('users',
                    'is_confirmed',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('users',
                    'is_active_premium',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=True)
    op.alter_column('exams_taken',
                    'other_data',
                    existing_type=sa.Text(),
                    type_=sa.BLOB(),
                    existing_nullable=True)
    op.alter_column('exams_taken',
                    'date_taken',
                    existing_type=sa.DateTime(),
                    type_=sa.DATE(),
                    existing_nullable=False)
    op.alter_column('courses',
                    'randomize_questions',
                    existing_type=sa.Boolean(),
                    type_=mysql.TINYINT(display_width=1),
                    existing_nullable=False)
コード例 #29
0
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        'user', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('public_id', sa.String(length=50), nullable=True),
        sa.Column('username', sa.String(length=64), nullable=True),
        sa.Column('email', sa.String(length=120), nullable=True),
        sa.Column('password', sa.String(length=128), nullable=True),
        sa.Column('avatar', sa.BLOB(), nullable=True),
        sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('public_id'))
    op.create_index(op.f('ix_user_email'), 'user', ['email'], unique=True)
    op.create_index(op.f('ix_user_username'),
                    'user', ['username'],
                    unique=True)
    op.create_table('recipe', sa.Column('id', sa.Integer(), nullable=False),
                    sa.Column('title', sa.String(length=140), nullable=True),
                    sa.Column('slug', sa.String(length=140), nullable=True),
                    sa.Column('body', sa.Text(), nullable=True),
                    sa.Column('time_stamp', sa.DateTime(), nullable=True),
                    sa.Column('user_id', sa.String(), nullable=True),
                    sa.ForeignKeyConstraint(
                        ['user_id'],
                        ['user.public_id'],
                    ), sa.PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_recipe_time_stamp'),
                    'recipe', ['time_stamp'],
                    unique=False)
コード例 #30
0
ファイル: edc2261bfd64_.py プロジェクト: f0cker/crackq
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('sessions',
    sa.Column('id', sa.INTEGER(), nullable=False),
    sa.Column('session_id', sa.VARCHAR(length=255), nullable=True),
    sa.Column('data', sa.BLOB(), nullable=True),
    sa.Column('expiry', sa.DATETIME(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('session_id')
    )
    with op.batch_alter_table('tasks', schema=None) as batch_op:
        batch_op.alter_column('id',
               existing_type=sa.NUMERIC(precision=16),
               type_=sqlalchemy_utils.types.uuid.UUIDType(),
               existing_nullable=False)

    with op.batch_alter_table('templates', schema=None) as batch_op:
        batch_op.alter_column('id',
               existing_type=sa.NUMERIC(precision=16),
               type_=sqlalchemy_utils.types.uuid.UUIDType(),
               existing_nullable=False)

    with op.batch_alter_table('user', schema=None) as batch_op:
        batch_op.add_column(sa.Column('task_ids', sa.JSON(), nullable=True))
        batch_op.alter_column('id',
               existing_type=sa.NUMERIC(precision=16),
               type_=sqlalchemy_utils.types.uuid.UUIDType(),
               existing_nullable=False)
        batch_op.create_unique_constraint('task_ids', ['task_ids'])
        try:
            batch_op.drop_column('password_hash')
        except Exception:
            pass