當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。