当前位置: 首页>>代码示例>>Python>>正文


Python sqlalchemy.BigInteger方法代码示例

本文整理汇总了Python中sqlalchemy.BigInteger方法的典型用法代码示例。如果您正苦于以下问题:Python sqlalchemy.BigInteger方法的具体用法?Python sqlalchemy.BigInteger怎么用?Python sqlalchemy.BigInteger使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在sqlalchemy的用法示例。


在下文中一共展示了sqlalchemy.BigInteger方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    '''
    Upgrade the database to this revision
    '''

    if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
        schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
        add_column('collection_replicas', sa.Column('available_replicas_cnt', sa.BigInteger()), schema=schema)
        add_column('collection_replicas', sa.Column('available_bytes', sa.BigInteger()), schema=schema)

        create_table('updated_col_rep',
                     sa.Column('id', GUID()),
                     sa.Column('scope', sa.String(25)),
                     sa.Column('name', sa.String(255)),
                     sa.Column('did_type', DIDType.db_type()),
                     sa.Column('rse_id', GUID()),
                     sa.Column('created_at', sa.DateTime, default=datetime.datetime.utcnow),
                     sa.Column('updated_at', sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow))

        create_primary_key('UPDATED_COL_REP_PK', 'updated_col_rep', ['id'])
        create_check_constraint('UPDATED_COL_REP_SCOPE_NN', 'updated_col_rep', 'scope IS NOT NULL')
        create_check_constraint('UPDATED_COL_REP_NAME_NN', 'updated_col_rep', 'name IS NOT NULL')
        create_index('UPDATED_COL_REP_SNR_IDX', 'updated_col_rep', ['scope', 'name', 'rse_id']) 
开发者ID:rucio,项目名称:rucio,代码行数:25,代码来源:3ad36e2268b0_create_collection_replicas_updates_table.py

示例2: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    '''
    Upgrade the database to this revision
    '''

    if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
        create_table(table_name,
                     sa.Column('rse_expression', sa.String(3000)),
                     sa.Column('bytes', sa.BigInteger()),
                     sa.Column('account', sa.String(25)),
                     sa.Column('created_at', sa.DateTime, default=datetime.datetime.utcnow),
                     sa.Column('updated_at', sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow))
        create_primary_key('ACCOUNT_GLOB_LIMITS_PK', table_name, ['account', 'rse_expression'])
        create_check_constraint('ACCOUNT_GLOB_LIMITS_CREATED_NN', table_name, 'created_at is not null')
        create_check_constraint('ACCOUNT_GLOB_LIMITS_UPDATED_NN', table_name, 'updated_at is not null')
        create_foreign_key('ACCOUNT_GLOBAL_LIMITS_ACC_FK', table_name, 'accounts', ['account'], ['account']) 
开发者ID:rucio,项目名称:rucio,代码行数:18,代码来源:a74275a1ad30_added_global_quota_table.py

示例3: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    '''
    Upgrade the database to this revision
    '''

    if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
        create_table('rse_transfer_limits',
                     sa.Column('rse_id', GUID()),
                     sa.Column('activity', sa.String(50)),
                     sa.Column('rse_expression', sa.String(3000)),
                     sa.Column('max_transfers', sa.BigInteger),
                     sa.Column('transfers', sa.BigInteger),
                     sa.Column('waitings', sa.BigInteger),
                     sa.Column('created_at', sa.DateTime, default=datetime.datetime.utcnow),
                     sa.Column('updated_at', sa.DateTime, default=datetime.datetime.utcnow, onupdate=datetime.datetime.utcnow))

        create_primary_key('RSE_TRANSFER_LIMITS_PK', 'rse_transfer_limits', ['rse_id', 'activity'])
        create_check_constraint('RSE_TRANSFER_LIMITS_CREATED_NN', 'rse_transfer_limits', 'created_at is not null')
        create_check_constraint('RSE_TRANSFER_LIMITS_UPDATED_NN', 'rse_transfer_limits', 'updated_at is not null')
        create_foreign_key('RSE_TRANSFER_LIMITS_RSE_ID_FK', 'rse_transfer_limits', 'rses', ['rse_id'], ['id']) 
开发者ID:rucio,项目名称:rucio,代码行数:22,代码来源:379a19b5332d_create_rse_limits_table.py

示例4: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    '''
    Upgrade the database to this revision
    '''

    if context.get_context().dialect.name in ['oracle', 'mysql', 'postgresql']:
        create_table('sources_history',
                     sa.Column('request_id', GUID()),
                     sa.Column('scope', sa.String(25)),
                     sa.Column('name', sa.String(255)),
                     sa.Column('rse_id', GUID()),
                     sa.Column('dest_rse_id', GUID()),
                     sa.Column('url', sa.String(2048)),
                     sa.Column('bytes', sa.BigInteger),
                     sa.Column('ranking', sa.Integer()),
                     sa.Column('is_using', sa.Boolean(), default=False))
        schema = context.get_context().version_table_schema if context.get_context().version_table_schema else ''
        add_column('requests', sa.Column('estimated_at', sa.DateTime), schema=schema)
        add_column('requests_history', sa.Column('estimated_at', sa.DateTime), schema=schema) 
开发者ID:rucio,项目名称:rucio,代码行数:21,代码来源:575767d9f89_added_source_history_table.py

示例5: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('rss_parser_feed_name_lut', sa.Column('feed_id', sa.BigInteger(), nullable=False))
    op.create_index(op.f('ix_rss_parser_feed_name_lut_feed_id'), 'rss_parser_feed_name_lut', ['feed_id'], unique=False)
    op.drop_index('ix_rss_parser_feed_name_lut_feed_name', table_name='rss_parser_feed_name_lut')
    op.drop_constraint('rss_parser_feed_name_lut_feed_netloc_feed_name_key', 'rss_parser_feed_name_lut', type_='unique')
    op.create_unique_constraint(None, 'rss_parser_feed_name_lut', ['feed_netloc', 'feed_id'])
    op.drop_constraint('rss_parser_feed_name_lut_feed_name_fkey', 'rss_parser_feed_name_lut', type_='foreignkey')
    op.create_foreign_key(None, 'rss_parser_feed_name_lut', 'rss_parser_funcs', ['feed_id'], ['id'])
    op.drop_column('rss_parser_feed_name_lut', 'feed_name')
    op.add_column('rss_parser_feed_name_lut_version', sa.Column('feed_id', sa.BigInteger(), autoincrement=False, nullable=True))
    op.create_index(op.f('ix_rss_parser_feed_name_lut_version_feed_id'), 'rss_parser_feed_name_lut_version', ['feed_id'], unique=False)
    op.drop_index('ix_rss_parser_feed_name_lut_version_feed_name', table_name='rss_parser_feed_name_lut_version')
    op.drop_column('rss_parser_feed_name_lut_version', 'feed_name')
    op.alter_column('rss_parser_funcs', 'func',
               existing_type=sa.TEXT(),
               nullable=True)
    ### end Alembic commands ### 
开发者ID:fake-name,项目名称:ReadableWebProxy,代码行数:20,代码来源:00027_c92e0c8632d7_more_rss_stuff.py

示例6: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('key_value_store',
        sa.Column('id', sa.BigInteger(), nullable=False),
        sa.Column('key', sa.Text(), nullable=False),
        sa.Column('value', postgresql.JSONB(astext_type=sa.Text()), nullable=True),
        sa.PrimaryKeyConstraint('id')
    )

    print("Creating index")
    op.create_index(op.f('ix_key_value_store_key'), 'key_value_store', ['key'], unique=True)
    print("Applying not-null constraing")
    op.alter_column('nu_release_item', 'release_date',
               existing_type=postgresql.TIMESTAMP(),
               nullable=False)
    # ### end Alembic commands ### 
开发者ID:fake-name,项目名称:ReadableWebProxy,代码行数:18,代码来源:00042_49308bd51717_kvstore_table.py

示例7: test_column_adaptation

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_column_adaptation(metadata):
    Table("simple_items", metadata, Column("id", postgresql.BIGINT), Column("length", postgresql.DOUBLE_PRECISION))

    assert (
        generate_code(metadata)
        == """\
# coding: utf-8
from sqlalchemy import BigInteger, Column, Float, MetaData, Table

metadata = MetaData()


t_simple_items = Table(
    'simple_items', metadata,
    Column('id', BigInteger),
    Column('length', Float)
)
"""
    ) 
开发者ID:thomaxxl,项目名称:safrs,代码行数:21,代码来源:test_codegen.py

示例8: test_alter_column_autoincrement_pk_false

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_pk_false(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("x", Integer, primary_key=True, autoincrement=False),
        )
        Table(
            "a",
            m2,
            Column("x", BigInteger, primary_key=True, autoincrement=False),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        is_(ops.ops[0].ops[0].kw["autoincrement"], False) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:19,代码来源:test_autogen_diffs.py

示例9: test_alter_column_autoincrement_nonpk_false

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_nonpk_false(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("id", Integer, primary_key=True),
            Column("x", Integer, autoincrement=False),
        )
        Table(
            "a",
            m2,
            Column("id", Integer, primary_key=True),
            Column("x", BigInteger, autoincrement=False),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        is_(ops.ops[0].ops[0].kw["autoincrement"], False) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:21,代码来源:test_autogen_diffs.py

示例10: test_alter_column_autoincrement_nonpk_implicit_false

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_nonpk_implicit_false(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("id", Integer, primary_key=True),
            Column("x", Integer),
        )
        Table(
            "a",
            m2,
            Column("id", Integer, primary_key=True),
            Column("x", BigInteger),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        assert "autoincrement" not in ops.ops[0].ops[0].kw 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:21,代码来源:test_autogen_diffs.py

示例11: test_alter_column_autoincrement_nonpk_explicit_true

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_nonpk_explicit_true(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("id", Integer, primary_key=True),
            Column("x", Integer, autoincrement=True),
        )
        Table(
            "a",
            m2,
            Column("id", Integer, primary_key=True),
            Column("x", BigInteger, autoincrement=True),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        is_(ops.ops[0].ops[0].kw["autoincrement"], True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:21,代码来源:test_autogen_diffs.py

示例12: test_alter_column_autoincrement_compositepk_false

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_compositepk_false(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("id", Integer, primary_key=True),
            Column("x", Integer, primary_key=True, autoincrement=False),
        )
        Table(
            "a",
            m2,
            Column("id", Integer, primary_key=True),
            Column("x", BigInteger, primary_key=True, autoincrement=False),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        is_(ops.ops[0].ops[0].kw["autoincrement"], False) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:21,代码来源:test_autogen_diffs.py

示例13: test_alter_column_autoincrement_compositepk_explicit_true

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def test_alter_column_autoincrement_compositepk_explicit_true(self):
        m1 = MetaData()
        m2 = MetaData()

        Table(
            "a",
            m1,
            Column("id", Integer, primary_key=True, autoincrement=False),
            Column("x", Integer, primary_key=True, autoincrement=True),
            # on SQLA 1.0 and earlier, this being present
            # trips the "add KEY for the primary key" so that the
            # AUTO_INCREMENT keyword is accepted by MySQL.  SQLA 1.1 and
            # greater the columns are just reorganized.
            mysql_engine="InnoDB",
        )
        Table(
            "a",
            m2,
            Column("id", Integer, primary_key=True, autoincrement=False),
            Column("x", BigInteger, primary_key=True, autoincrement=True),
        )

        ops = self._fixture(m1, m2, return_ops=True)
        is_(ops.ops[0].ops[0].kw["autoincrement"], True) 
开发者ID:sqlalchemy,项目名称:alembic,代码行数:26,代码来源:test_autogen_diffs.py

示例14: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    op.create_table(
        'opendaylightjournal_new',
        sa.Column('seqnum', sa.BigInteger(),
                  primary_key=True, autoincrement=True),
        sa.Column('object_type', sa.String(36), nullable=False),
        sa.Column('object_uuid', sa.String(36), nullable=False),
        sa.Column('operation', sa.String(36), nullable=False),
        sa.Column('data', sa.PickleType, nullable=True),
        sa.Column('state',
                  sa.Enum('pending', 'processing', 'failed', 'completed',
                          name='state'),
                  nullable=False, default='pending'),
        sa.Column('retry_count', sa.Integer, default=0),
        sa.Column('created_at', sa.DateTime, default=sa.func.now()),
        sa.Column('last_retried', sa.TIMESTAMP, server_default=sa.func.now(),
                  onupdate=sa.func.now()),
    ) 
开发者ID:openstack,项目名称:networking-odl,代码行数:20,代码来源:3d560427d776_add_sequence_number_to_journal.py

示例15: upgrade

# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import BigInteger [as 别名]
def upgrade():
    op.create_table('job_statistics',
    sa.Column('id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('job_id', postgresql.UUID(as_uuid=True), nullable=False),
    sa.Column('emails_sent', sa.BigInteger(), nullable=False),
    sa.Column('emails_delivered', sa.BigInteger(), nullable=False),
    sa.Column('emails_failed', sa.BigInteger(), nullable=False),
    sa.Column('sms_sent', sa.BigInteger(), nullable=False),
    sa.Column('sms_delivered', sa.BigInteger(), nullable=False),
    sa.Column('sms_failed', sa.BigInteger(), nullable=False),
    sa.Column('letters_sent', sa.BigInteger(), nullable=False),
    sa.Column('letters_failed', sa.BigInteger(), nullable=False),
    sa.Column('created_at', sa.DateTime(), nullable=True),
    sa.Column('updated_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['job_id'], ['jobs.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_job_statistics_job_id'), 'job_statistics', ['job_id'], unique=True) 
开发者ID:alphagov,项目名称:notifications-api,代码行数:20,代码来源:0084_add_job_stats.py


注:本文中的sqlalchemy.BigInteger方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。