本文整理汇总了Python中sqlalchemy.dialects.mysql.MEDIUMTEXT属性的典型用法代码示例。如果您正苦于以下问题:Python mysql.MEDIUMTEXT属性的具体用法?Python mysql.MEDIUMTEXT怎么用?Python mysql.MEDIUMTEXT使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sqlalchemy.dialects.mysql
的用法示例。
在下文中一共展示了mysql.MEDIUMTEXT属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: upgrade
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('extension',
sa.Column('created', sa.DateTime(timezone=True), server_default=sa.text('now()'), nullable=False),
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('staff_id', sa.Integer(), nullable=False),
sa.Column('assignment_id', sa.Integer(), nullable=False),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('message', mysql.MEDIUMTEXT(), nullable=True),
sa.Column('expires', sa.DateTime(timezone=True), nullable=True),
sa.Column('custom_submission_time', sa.DateTime(timezone=True), nullable=True),
sa.ForeignKeyConstraint(['assignment_id'], ['assignment.id'], name=op.f('fk_extension_assignment_id_assignment')),
sa.ForeignKeyConstraint(['staff_id'], ['user.id'], name=op.f('fk_extension_staff_id_user')),
sa.ForeignKeyConstraint(['user_id'], ['user.id'], name=op.f('fk_extension_user_id_user')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_extension')),
sa.UniqueConstraint('assignment_id', 'user_id', name=op.f('uq_extension_assignment_id_user_id'))
)
# ### end Alembic commands ###
示例2: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例3: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例4: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
开发者ID:mitmedialab,项目名称:CivilServant,代码行数:20,代码来源:aae7a3158d13_added_comment_archive_table_to_split_.py
示例5: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
开发者ID:mitmedialab,项目名称:CivilServant,代码行数:20,代码来源:aae7a3158d13_added_comment_archive_table_to_split_.py
示例6: upgrade_production
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def upgrade_production():
### 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 ###
开发者ID:mitmedialab,项目名称:CivilServant,代码行数:20,代码来源:aae7a3158d13_added_comment_archive_table_to_split_.py
示例7: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例8: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例9: upgrade_production
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def upgrade_production():
### 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 ###
示例10: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例11: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例12: upgrade_production
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
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 ###
示例13: upgrade_development
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def upgrade_development():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('message_logs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('message_sent', sa.Boolean(), nullable=True),
sa.Column('message_failure_reason', sa.String(length=63), nullable=True),
sa.Column('platform', sa.String(length=64), nullable=True),
sa.Column('username', sa.String(length=256), nullable=True),
sa.Column('subject', sa.String(length=256), nullable=True),
sa.Column('message_task_id', sa.String(length=256), nullable=True),
sa.Column('body', mysql.MEDIUMTEXT(), nullable=True),
sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_message_logs_created_at'), 'message_logs', ['created_at'], unique=False)
op.create_index(op.f('ix_message_logs_message_task_id'), 'message_logs', ['message_task_id'], unique=False)
op.create_index(op.f('ix_message_logs_platform'), 'message_logs', ['platform'], unique=False)
op.create_index(op.f('ix_message_logs_username'), 'message_logs', ['username'], unique=False)
op.drop_index('ix_mod_actions_created_utc_index', table_name='mod_actions')
# ### end Alembic commands ###
示例14: upgrade_test
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def upgrade_test():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('message_logs',
sa.Column('id', sa.Integer(), nullable=False),
sa.Column('created_at', sa.DateTime(), nullable=True),
sa.Column('message_sent', sa.Boolean(), nullable=True),
sa.Column('message_failure_reason', sa.String(length=63), nullable=True),
sa.Column('platform', sa.String(length=64), nullable=True),
sa.Column('username', sa.String(length=256), nullable=True),
sa.Column('subject', sa.String(length=256), nullable=True),
sa.Column('message_task_id', sa.String(length=256), nullable=True),
sa.Column('body', mysql.MEDIUMTEXT(), nullable=True),
sa.Column('metadata_json', mysql.MEDIUMTEXT(), nullable=True),
sa.PrimaryKeyConstraint('id')
)
op.create_index(op.f('ix_message_logs_created_at'), 'message_logs', ['created_at'], unique=False)
op.create_index(op.f('ix_message_logs_message_task_id'), 'message_logs', ['message_task_id'], unique=False)
op.create_index(op.f('ix_message_logs_platform'), 'message_logs', ['platform'], unique=False)
op.create_index(op.f('ix_message_logs_username'), 'message_logs', ['username'], unique=False)
op.drop_index('ix_mod_actions_created_utc_index', table_name='mod_actions')
# ### end Alembic commands ###
示例15: MediumText
# 需要导入模块: from sqlalchemy.dialects import mysql [as 别名]
# 或者: from sqlalchemy.dialects.mysql import MEDIUMTEXT [as 别名]
def MediumText():
return Text().with_variant(MEDIUMTEXT(), 'mysql')