本文整理汇总了Python中sqlalchemy.INTEGER属性的典型用法代码示例。如果您正苦于以下问题:Python sqlalchemy.INTEGER属性的具体用法?Python sqlalchemy.INTEGER怎么用?Python sqlalchemy.INTEGER使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类sqlalchemy
的用法示例。
在下文中一共展示了sqlalchemy.INTEGER属性的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
### commands auto generated by Alembic - please adjust! ###
op.create_table('months',
sa.Column('id', sa.INTEGER(), server_default=sa.text("nextval('months_id_seq'::regclass)"), nullable=False),
sa.Column('month', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('year', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('department_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['department_id'], ['departments.id'], name='months_department_id_fkey'),
sa.PrimaryKeyConstraint('id', name='months_pkey'),
postgresql_ignore_search_path=False
)
op.create_table('serviceTypes',
sa.Column('id', sa.INTEGER(), server_default=sa.text('nextval(\'"serviceTypes_id_seq"\'::regclass)'), nullable=False),
sa.Column('month_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('service_type', sa.VARCHAR(length=36), autoincrement=False, nullable=False),
sa.Column('count', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['month_id'], ['months.id'], name='serviceTypes_month_id_fkey'),
sa.PrimaryKeyConstraint('id', name='serviceTypes_pkey')
)
op.drop_table('use_of_force_incidents')
### end Alembic commands ###
示例2: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
bind = op.get_bind()
session = Session(bind=bind)
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('pull_mirror', sa.Column('gitlab_id', sa.INTEGER(), nullable=True))
for pull_mirror in session.query(PullMirror):
pull_mirror.gitlab_id = pull_mirror.project.gitlab_id
session.add(pull_mirror)
session.commit()
op.drop_constraint(None, 'pull_mirror', type_='foreignkey')
op.drop_index(op.f('ix_pull_mirror_project_id'), table_name='pull_mirror')
op.drop_column('pull_mirror', 'project_id')
op.drop_index(op.f('ix_push_mirror_user_id'), table_name='push_mirror')
op.drop_index(op.f('ix_push_mirror_project_id'), table_name='push_mirror')
op.drop_table('push_mirror')
op.drop_table('project')
# ### end Alembic commands ###
示例3: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('client_scope',
sa.Column('client_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('scope_id', sa.INTEGER(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['client_id'], ['client.id'], name='client_scope_client_id_fkey', ondelete='CASCADE'),
sa.ForeignKeyConstraint(['scope_id'], ['scope.id'], name='client_scope_scope_id_fkey', ondelete='CASCADE'),
sa.PrimaryKeyConstraint('client_id', 'scope_id', name='client_scope_pkey')
)
op.create_table('scope',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('created_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.Column('updated_at', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('name', sa.VARCHAR(length=128), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='scope_pkey'),
sa.UniqueConstraint('name', name='scope_name_key')
)
# ### end Alembic commands ###
示例4: upgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('apple_subscription',
sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
sa.Column('created_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('updated_at', sqlalchemy_utils.types.arrow.ArrowType(), nullable=True),
sa.Column('user_id', sa.Integer(), nullable=False),
sa.Column('expires_date', sqlalchemy_utils.types.arrow.ArrowType(), nullable=False),
sa.Column('original_transaction_id', sa.String(length=256), nullable=False),
sa.Column('receipt_data', sa.Text(), nullable=False),
sa.Column('plan', sa.Enum('monthly', 'yearly', name='planenum_apple'), nullable=False),
sa.ForeignKeyConstraint(['user_id'], ['users.id'], ondelete='cascade'),
sa.PrimaryKeyConstraint('id'),
sa.UniqueConstraint('user_id')
)
op.alter_column('file', 'user_id',
existing_type=sa.INTEGER(),
nullable=True)
# ### end Alembic commands ###
示例5: upgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def upgrade():
""" Create table for PagureNoNewBranchesHook. """
op.create_table(
'hook_pagure_no_new_branches',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('project_id', sa.INTEGER(), nullable=False),
sa.Column('active', sa.BOOLEAN(), nullable=False),
sa.ForeignKeyConstraint(
['project_id'],
[u'projects.id'],
name=u'hook_pagure_no_new_branches_project_id_fkey',
onupdate=u'CASCADE',
ondelete=u'CASCADE'
),
sa.PrimaryKeyConstraint('id', name=u'hook_pagure_no_new_branches_pkey')
)
示例6: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('organisation', 'system_blockchain_address')
op.create_table('spend_approvals',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('eth_send_task_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('approval_task_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('token_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('giving_transfer_account_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('receiving_transfer_account_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['giving_transfer_account_id'], ['transfer_account.id'], name='spend_approvals_giving_transfer_account_id_fkey'),
sa.ForeignKeyConstraint(['receiving_transfer_account_id'], ['transfer_account.id'], name='spend_approvals_receiving_transfer_account_id_fkey'),
sa.ForeignKeyConstraint(['token_id'], ['token.id'], name='spend_approvals_token_id_fkey'),
sa.PrimaryKeyConstraint('id', name='spend_approvals_pkey')
)
op.drop_table('spend_approval')
# ### end Alembic commands ###
示例7: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('chatbot_state_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('user_chatbot_state_id_fkey', 'user', 'chatbot_state', ['chatbot_state_id'], ['id'])
op.create_table('chatbot_state',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('transfer_initialised', sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.Column('transfer_amount', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('prev_pin_failures', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('last_accessed', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('provider_message_id', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('target_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='chatbot_state_pkey')
)
# ### end Alembic commands ###
示例8: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('targeting_survey_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('user_targeting_survey_id_fkey', 'user', 'targeting_survey', ['targeting_survey_id'], ['id'])
op.create_table('targeting_survey',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('number_people_household', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('number_below_adult_age_household', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('number_people_women_household', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('number_people_men_household', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('number_people_work_household', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('disabilities_household', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('long_term_illnesses_household', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='targeting_survey_pkey')
)
# ### end Alembic commands ###
示例9: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('_public_serial_number', sa.VARCHAR(), autoincrement=False, nullable=True))
op.drop_column('user', 'public_serial_number')
op.add_column('uploaded_document', sa.Column('business_verification_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'uploaded_document', type_='foreignkey')
op.create_foreign_key('uploaded_document_business_verification_id_fkey', 'uploaded_document', 'kyc_application', ['business_verification_id'], ['id'])
op.drop_column('uploaded_document', 'kyc_application_id')
op.add_column('transfer_card', sa.Column('amount_loaded_signature', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('transfer_card', sa.Column('user_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('transfer_card', sa.Column('_amount_loaded', sa.INTEGER(), autoincrement=False, nullable=True))
op.create_foreign_key('transfer_card_user_id_fkey', 'transfer_card', 'user', ['user_id'], ['id'])
op.drop_column('kyc_application', 'type')
op.add_column('credit_transfer', sa.Column('uuid', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('blockchain_transaction', sa.Column('is_bitcoin', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.add_column('blockchain_transaction', sa.Column('has_output_txn', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.add_column('bank_account', sa.Column('business_verification_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'bank_account', type_='foreignkey')
op.create_foreign_key('bank_account_business_verification_id_fkey', 'bank_account', 'kyc_application', ['business_verification_id'], ['id'])
op.drop_column('bank_account', 'wyre_id')
op.drop_column('bank_account', 'kyc_application_id')
# ### end Alembic commands ###
示例10: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column('user', sa.Column('is_superadmin', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.add_column('user', sa.Column('is_admin', sa.BOOLEAN(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'user', type_='foreignkey')
op.drop_column('user', 'secret')
op.drop_column('user', 'public_serial_number')
op.drop_column('user', 'nfc_serial_number')
op.drop_column('user', 'chatbot_state_id')
op.drop_column('user', '_is_superadmin')
op.drop_column('user', '_is_subadmin')
op.drop_column('user', '_is_admin')
op.create_table('pin_to_public_id',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('public_id', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('PIN', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='pin_to_public_id_pkey')
)
op.drop_table('public_serial_number')
op.drop_table('chatbot_state')
# ### end Alembic commands ###
示例11: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'primary_blockchain_address')
op.drop_column('user', 'is_public')
op.add_column('transfer_account', sa.Column('balance', sa.BIGINT(), autoincrement=False, nullable=True))
op.drop_constraint(None, 'transfer_account', type_='foreignkey')
op.drop_column('transfer_account', 'is_public')
op.drop_column('transfer_account', 'exchange_contract_id')
op.drop_column('transfer_account', '_balance_wei')
op.drop_column('email_whitelist', 'is_public')
op.add_column('credit_transfer', sa.Column('transfer_amount', sa.INTEGER(), autoincrement=False, nullable=True))
op.drop_column('credit_transfer', 'is_public')
op.drop_column('credit_transfer', '_transfer_amount_wei')
op.drop_column('blockchain_address', 'is_public')
op.drop_table('exchange_contract_token_association_table')
op.drop_index(op.f('ix_exchange_contract_contract_registry_blockchain_address'), table_name='exchange_contract')
op.drop_index(op.f('ix_exchange_contract_blockchain_address'), table_name='exchange_contract')
op.drop_table('exchange_contract')
op.drop_table('exchange')
# ### end Alembic commands ###
示例12: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('blockchain_transaction',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('submitted_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('added_date', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('hash', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('credit_transfer_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('block', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('status', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('transaction_type', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('message', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('signing_blockchain_address_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('nonce', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('has_output_txn', sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.Column('is_bitcoin', sa.BOOLEAN(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['credit_transfer_id'], ['credit_transfer.id'], name='blockchain_transaction_credit_transfer_id_fkey'),
sa.ForeignKeyConstraint(['signing_blockchain_address_id'], ['blockchain_address.id'], name='blockchain_transaction_signing_blockchain_address_id_fkey'),
sa.PrimaryKeyConstraint('id', name='blockchain_transaction_pkey')
)
# ### end Alembic commands ###
示例13: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column('user', 'last_name')
op.drop_column('user', 'first_name')
op.add_column('transfer_account', sa.Column('vendor_id', sa.INTEGER(), autoincrement=False, nullable=True))
op.add_column('transfer_account', sa.Column('first_name', sa.VARCHAR(), autoincrement=False, nullable=True))
op.add_column('transfer_account', sa.Column('last_name', sa.VARCHAR(), autoincrement=False, nullable=True))
op.create_foreign_key('transfer_account_vendor_id_fkey', 'transfer_account', 'transfer_account', ['vendor_id'], ['id'])
op.drop_column('transfer_account', 'payable_period_type')
op.drop_column('transfer_account', 'payable_period_length')
op.drop_column('transfer_account', 'payable_epoch')
op.drop_column('transfer_account', 'name')
op.drop_column('transfer_account', 'is_vendor')
op.create_table('vendor',
sa.Column('id', sa.INTEGER(), nullable=False),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('name', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('payable_period_type', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('payable_period_length', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.PrimaryKeyConstraint('id', name='vendor_pkey')
)
# ### end Alembic commands ###
示例14: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('referral',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('authorising_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column('created', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('updated', postgresql.TIMESTAMP(), autoincrement=False, nullable=True),
sa.Column('first_name', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('last_name', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('reason', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('_phone', sa.VARCHAR(), autoincrement=False, nullable=True),
sa.Column('referring_user_id', sa.INTEGER(), autoincrement=False, nullable=True),
sa.ForeignKeyConstraint(['referring_user_id'], ['user.id'], name='referral_referring_user_id_fkey'),
sa.PrimaryKeyConstraint('id', name='referral_pkey')
)
# ### end Alembic commands ###
示例15: downgrade
# 需要导入模块: import sqlalchemy [as 别名]
# 或者: from sqlalchemy import INTEGER [as 别名]
def downgrade():
op.create_table(
"project_members",
sa.Column("user_id", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column("project_id", sa.INTEGER(), autoincrement=False, nullable=True),
sa.Column(
"date_joined", postgresql.TIMESTAMP(), autoincrement=False, nullable=True
),
sa.Column("is_lead", sa.BOOLEAN(), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(
["project_id"], ["projects.id"], name="project_members_project_id_fkey"
),
sa.ForeignKeyConstraint(
["user_id"], ["users.id"], name="project_members_user_id_fkey"
),
)
op.drop_index(
op.f("ix_project_memberships_is_lead"), table_name="project_memberships"
)
op.drop_table("project_memberships")