python类MEDIUMTEXT的实例源码

66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
66a893890997_add_user_table.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def upgrade_production():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('users',
    sa.Column('name', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('first_seen', sa.DateTime(), nullable=True),
    sa.Column('last_seen', sa.DateTime(), nullable=True),
    sa.Column('user_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('name'),
    sa.UniqueConstraint('name')
    )
    # removed to fix merge conflict
    #op.add_column('posts', sa.Column('created_at', sa.DateTime(), nullable=True))
#    op.drop_index('posts_ibfk_1', table_name='posts')
    op.add_column('subreddits', sa.Column('created_at', sa.DateTime(), nullable=True))
    ### end Alembic commands ###
aae7a3158d13_added_comment_archive_table_to_split_.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 33 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('archived_comments',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('post_id', sa.String(length=32), nullable=True),
    sa.Column('user_id', sa.String(length=64), nullable=True),
    sa.Column('comment_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_archived_comments_created_at'), 'archived_comments', ['created_at'], unique=False)
    op.create_index(op.f('ix_archived_comments_post_id'), 'archived_comments', ['post_id'], unique=False)
    op.create_index(op.f('ix_archived_comments_subreddit_id'), 'archived_comments', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_archived_comments_user_id'), 'archived_comments', ['user_id'], unique=False)
    ### end Alembic commands ###
aae7a3158d13_added_comment_archive_table_to_split_.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('archived_comments',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('post_id', sa.String(length=32), nullable=True),
    sa.Column('user_id', sa.String(length=64), nullable=True),
    sa.Column('comment_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_archived_comments_created_at'), 'archived_comments', ['created_at'], unique=False)
    op.create_index(op.f('ix_archived_comments_post_id'), 'archived_comments', ['post_id'], unique=False)
    op.create_index(op.f('ix_archived_comments_subreddit_id'), 'archived_comments', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_archived_comments_user_id'), 'archived_comments', ['user_id'], unique=False)
    ### end Alembic commands ###
4430bb0ac79d_add_modaction_model.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 22 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mod_actions',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('mod', sa.String(length=64), nullable=True),
    sa.Column('target_author', sa.String(length=64), nullable=True),
    sa.Column('action', sa.String(length=256), nullable=True),
    sa.Column('target_fullname', sa.String(length=256), nullable=True),
    sa.Column('action_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_mod_actions_subreddit_id'), 'mod_actions', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_mod_actions_target_author'), 'mod_actions', ['target_author'], unique=False)
    ### end Alembic commands ###
4430bb0ac79d_add_modaction_model.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('mod_actions',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('mod', sa.String(length=64), nullable=True),
    sa.Column('target_author', sa.String(length=64), nullable=True),
    sa.Column('action', sa.String(length=256), nullable=True),
    sa.Column('target_fullname', sa.String(length=256), nullable=True),
    sa.Column('action_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_mod_actions_subreddit_id'), 'mod_actions', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_mod_actions_target_author'), 'mod_actions', ['target_author'], unique=False)
    ### end Alembic commands ###
e06fa0a86214_added_comment_model.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 28 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('comments',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('post_id', sa.String(length=32), nullable=True),
    sa.Column('user_id', sa.String(length=64), nullable=True),
    sa.Column('comment_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_comments_post_id'), 'comments', ['post_id'], unique=False)
    op.create_index(op.f('ix_comments_subreddit_id'), 'comments', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_comments_user_id'), 'comments', ['user_id'], unique=False)
    ### end Alembic commands ###
e06fa0a86214_added_comment_model.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 27 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('comments',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('post_id', sa.String(length=32), nullable=True),
    sa.Column('user_id', sa.String(length=64), nullable=True),
    sa.Column('comment_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_comments_post_id'), 'comments', ['post_id'], unique=False)
    op.create_index(op.f('ix_comments_subreddit_id'), 'comments', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_comments_user_id'), 'comments', ['user_id'], unique=False)
    ### end Alembic commands ###
e06fa0a86214_added_comment_model.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def upgrade_production():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('comments',
    sa.Column('id', sa.String(length=256), autoincrement=False, nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('created_utc', sa.DateTime(), nullable=True),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('post_id', sa.String(length=32), nullable=True),
    sa.Column('user_id', sa.String(length=64), nullable=True),
    sa.Column('comment_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_index(op.f('ix_comments_post_id'), 'comments', ['post_id'], unique=False)
    op.create_index(op.f('ix_comments_subreddit_id'), 'comments', ['subreddit_id'], unique=False)
    op.create_index(op.f('ix_comments_user_id'), 'comments', ['user_id'], unique=False)
    ### end Alembic commands ###
002_resource.py 文件源码 项目:trio2o 作者: openstack 项目源码 文件源码 阅读 39 收藏 0 点赞 0 评论 0
def MediumText():
    return sql.Text().with_variant(mysql.MEDIUMTEXT(), 'mysql')
models.py 文件源码 项目:trio2o 作者: openstack 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def MediumText():
    return sql.Text().with_variant(mysql.MEDIUMTEXT(), 'mysql')


# Resource Model
models.py 文件源码 项目:zun 作者: openstack 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def MediumText():
    return Text().with_variant(MEDIUMTEXT(), 'mysql')
d2ae31099d61_increase_text_size_for_mysql.py 文件源码 项目:incubator-airflow-old 作者: apache 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def upgrade():
    if context.config.get_main_option('sqlalchemy.url').startswith('mysql'):
        op.alter_column(table_name='variable', column_name='val', type_=mysql.MEDIUMTEXT)
models.py 文件源码 项目:mogan 作者: openstack 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def MediumText():
    return Text().with_variant(MEDIUMTEXT(), 'mysql')
a0f4fda7588f_add_model_for_snapshots_of_.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_thing_snapshots',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('experiment_thing_id', sa.String(length=256), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_id'), 'experiment_thing_snapshots', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_thing_id'), 'experiment_thing_snapshots', ['experiment_thing_id'], unique=False)
    ### end Alembic commands ###
a0f4fda7588f_add_model_for_snapshots_of_.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_thing_snapshots',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('experiment_thing_id', sa.String(length=256), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_id'), 'experiment_thing_snapshots', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_thing_id'), 'experiment_thing_snapshots', ['experiment_thing_id'], unique=False)
    ### end Alembic commands ###
a0f4fda7588f_add_model_for_snapshots_of_.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def upgrade_production():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_thing_snapshots',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('experiment_thing_id', sa.String(length=256), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_id'), 'experiment_thing_snapshots', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_thing_snapshots_experiment_thing_id'), 'experiment_thing_snapshots', ['experiment_thing_id'], unique=False)
    ### end Alembic commands ###
4d46b88366fc_added_table_for_front_pages.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('front_pages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('page_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###
4d46b88366fc_added_table_for_front_pages.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('front_pages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('page_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    ### end Alembic commands ###
da0fe56f616b_create_models_for_experiment_objects.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_actions',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('praw_key_id', sa.String(length=256), nullable=True),
    sa.Column('action_subject_type', sa.String(length=64), nullable=True),
    sa.Column('action_subject_id', sa.String(length=256), nullable=True),
    sa.Column('action_object_type', sa.String(length=64), nullable=True),
    sa.Column('action_object_id', sa.String(length=256), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_actions_action_object_id'), 'experiment_actions', ['action_object_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_action_subject_id'), 'experiment_actions', ['action_subject_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_experiment_id'), 'experiment_actions', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_praw_key_id'), 'experiment_actions', ['praw_key_id'], unique=False)
    op.create_table('experiment_things',
    sa.Column('id', sa.String(length=256), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('object_created', sa.DateTime(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_things_experiment_id'), 'experiment_things', ['experiment_id'], unique=False)
    op.create_table('experiments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('controller', sa.String(length=256), nullable=False),
    sa.Column('start_time', sa.DateTime(), nullable=True),
    sa.Column('end_time', sa.DateTime(), nullable=True),
    sa.Column('settings_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiments_name'), 'experiments', ['name'], unique=False)
    ### end Alembic commands ###
da0fe56f616b_create_models_for_experiment_objects.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_actions',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('praw_key_id', sa.String(length=256), nullable=True),
    sa.Column('action_subject_type', sa.String(length=64), nullable=True),
    sa.Column('action_subject_id', sa.String(length=256), nullable=True),
    sa.Column('action_object_type', sa.String(length=64), nullable=True),
    sa.Column('action_object_id', sa.String(length=256), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_actions_action_object_id'), 'experiment_actions', ['action_object_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_action_subject_id'), 'experiment_actions', ['action_subject_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_experiment_id'), 'experiment_actions', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_praw_key_id'), 'experiment_actions', ['praw_key_id'], unique=False)
    op.create_table('experiment_things',
    sa.Column('id', sa.String(length=256), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('object_created', sa.DateTime(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_things_experiment_id'), 'experiment_things', ['experiment_id'], unique=False)
    op.create_table('experiments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('controller', sa.String(length=256), nullable=False),
    sa.Column('start_time', sa.DateTime(), nullable=True),
    sa.Column('end_time', sa.DateTime(), nullable=True),
    sa.Column('settings_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiments_name'), 'experiments', ['name'], unique=False)
    ### end Alembic commands ###
da0fe56f616b_create_models_for_experiment_objects.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 30 收藏 0 点赞 0 评论 0
def upgrade_production():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('experiment_actions',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('praw_key_id', sa.String(length=256), nullable=True),
    sa.Column('action_subject_type', sa.String(length=64), nullable=True),
    sa.Column('action_subject_id', sa.String(length=256), nullable=True),
    sa.Column('action_object_type', sa.String(length=64), nullable=True),
    sa.Column('action_object_id', sa.String(length=256), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_actions_action_object_id'), 'experiment_actions', ['action_object_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_action_subject_id'), 'experiment_actions', ['action_subject_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_experiment_id'), 'experiment_actions', ['experiment_id'], unique=False)
    op.create_index(op.f('ix_experiment_actions_praw_key_id'), 'experiment_actions', ['praw_key_id'], unique=False)
    op.create_table('experiment_things',
    sa.Column('id', sa.String(length=256), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('object_type', sa.Integer(), nullable=True),
    sa.Column('experiment_id', sa.Integer(), nullable=True),
    sa.Column('object_created', sa.DateTime(), nullable=True),
    sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiment_things_experiment_id'), 'experiment_things', ['experiment_id'], unique=False)
    op.create_table('experiments',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('name', sa.String(length=256), nullable=False),
    sa.Column('controller', sa.String(length=256), nullable=False),
    sa.Column('start_time', sa.DateTime(), nullable=True),
    sa.Column('end_time', sa.DateTime(), nullable=True),
    sa.Column('settings_json', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_experiments_name'), 'experiments', ['name'], unique=False)
    ### end Alembic commands ###
edc5377c32c7_adding_subreddit_page_and_post_tables.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def upgrade_development():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('subreddit_pages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('page_type', sa.Integer(), nullable=True),
    sa.Column('page_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('subreddits',
    sa.Column('id', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('name', sa.String(length=32), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('posts',
    sa.Column('id', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('post_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.ForeignKeyConstraint(['subreddit_id'], ['subreddits.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.add_column('front_pages', sa.Column('page_type', sa.Integer(), nullable=True))
    ### end Alembic commands ###
edc5377c32c7_adding_subreddit_page_and_post_tables.py 文件源码 项目:CivilServant 作者: mitmedialab 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def upgrade_test():
    ### commands auto generated by Alembic - please adjust! ###
    op.create_table('subreddit_pages',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('page_type', sa.Integer(), nullable=True),
    sa.Column('page_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('subreddits',
    sa.Column('id', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('name', sa.String(length=32), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.create_table('posts',
    sa.Column('id', sa.String(length=32), autoincrement=False, nullable=False),
    sa.Column('subreddit_id', sa.String(length=32), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('post_data', mysql.MEDIUMTEXT(), nullable=True),
    sa.ForeignKeyConstraint(['subreddit_id'], ['subreddits.id'], ),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('id')
    )
    op.add_column('front_pages', sa.Column('page_type', sa.Integer(), nullable=True))
    ### end Alembic commands ###
56eebc668baa_upgrade_the_contents_column_from_.py 文件源码 项目:quilt 作者: quiltdata 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def upgrade():
    op.alter_column('instance', 'contents',
               existing_type=mysql.MEDIUMTEXT(collation='utf8_bin'),
               type_=mysql.LONGTEXT(collation='utf8_bin'),
               existing_nullable=False)
56eebc668baa_upgrade_the_contents_column_from_.py 文件源码 项目:quilt 作者: quiltdata 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def downgrade():
    op.alter_column('instance', 'contents',
               existing_type=mysql.LONGTEXT(collation='utf8_bin'),
               type_=mysql.MEDIUMTEXT(collation='utf8_bin'),
               existing_nullable=False)
models.py 文件源码 项目:ranger-agent 作者: openstack 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def MediumText():
    return Text().with_variant(MEDIUMTEXT(), 'mysql')
models.py 文件源码 项目:Trusted-Platform-Module-nova 作者: BU-NU-CLOUD-SP16 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def MediumText():
    return Text().with_variant(MEDIUMTEXT(), 'mysql')


问题


面经


文章

微信
公众号

扫码关注公众号