Specified nullable fields for zksync models

pull/841/head
kompotkot 2023-07-12 12:30:39 +00:00
rodzic a7f5e6507f
commit 1b0a8581d3
2 zmienionych plików z 9 dodań i 15 usunięć

Wyświetl plik

@ -1,8 +1,8 @@
"""ZkSync Era model
Revision ID: b171fd85e058
Revision ID: e4a796c0407d
Revises: c413d5265f76
Create Date: 2023-07-12 11:20:19.295553
Create Date: 2023-07-12 12:27:12.814892
"""
from alembic import op
@ -10,7 +10,7 @@ import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision = 'b171fd85e058'
revision = 'e4a796c0407d'
down_revision = 'c413d5265f76'
branch_labels = None
depends_on = None
@ -46,7 +46,6 @@ def upgrade():
)
op.create_index(op.f('ix_zksync_era_testnet_blocks_block_number'), 'zksync_era_testnet_blocks', ['block_number'], unique=True)
op.create_index(op.f('ix_zksync_era_testnet_blocks_hash'), 'zksync_era_testnet_blocks', ['hash'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_blocks_l1_batch_number'), 'zksync_era_testnet_blocks', ['l1_batch_number'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_blocks_timestamp'), 'zksync_era_testnet_blocks', ['timestamp'], unique=False)
op.create_table('zksync_era_testnet_labels',
sa.Column('id', sa.UUID(), nullable=False),
@ -93,8 +92,6 @@ def upgrade():
op.create_index(op.f('ix_zksync_era_testnet_transactions_gas'), 'zksync_era_testnet_transactions', ['gas'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_transactions_gas_price'), 'zksync_era_testnet_transactions', ['gas_price'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_transactions_hash'), 'zksync_era_testnet_transactions', ['hash'], unique=True)
op.create_index(op.f('ix_zksync_era_testnet_transactions_l1_batch_number'), 'zksync_era_testnet_transactions', ['l1_batch_number'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_transactions_l1_batch_tx_index'), 'zksync_era_testnet_transactions', ['l1_batch_tx_index'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_transactions_to_address'), 'zksync_era_testnet_transactions', ['to_address'], unique=False)
op.create_index(op.f('ix_zksync_era_testnet_transactions_value'), 'zksync_era_testnet_transactions', ['value'], unique=False)
# ### end Alembic commands ###
@ -104,8 +101,6 @@ def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_index(op.f('ix_zksync_era_testnet_transactions_value'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_to_address'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_l1_batch_tx_index'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_l1_batch_number'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_hash'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_gas_price'), table_name='zksync_era_testnet_transactions')
op.drop_index(op.f('ix_zksync_era_testnet_transactions_gas'), table_name='zksync_era_testnet_transactions')
@ -121,7 +116,6 @@ def downgrade():
op.drop_index(op.f('ix_zksync_era_testnet_labels_address'), table_name='zksync_era_testnet_labels')
op.drop_table('zksync_era_testnet_labels')
op.drop_index(op.f('ix_zksync_era_testnet_blocks_timestamp'), table_name='zksync_era_testnet_blocks')
op.drop_index(op.f('ix_zksync_era_testnet_blocks_l1_batch_number'), table_name='zksync_era_testnet_blocks')
op.drop_index(op.f('ix_zksync_era_testnet_blocks_hash'), table_name='zksync_era_testnet_blocks')
op.drop_index(op.f('ix_zksync_era_testnet_blocks_block_number'), table_name='zksync_era_testnet_blocks')
op.drop_table('zksync_era_testnet_blocks')

Wyświetl plik

@ -642,11 +642,11 @@ class ZkSyncEraTestnetBlock(Base): # type: ignore
DateTime(timezone=True), server_default=utcnow(), nullable=False
)
mix_hash = Column(VARCHAR(256))
sha3_uncles = Column(VARCHAR(256))
mix_hash = Column(VARCHAR(256), nullable=True)
sha3_uncles = Column(VARCHAR(256), nullable=True)
l1_batch_number = Column(BigInteger, index=True)
l1_batch_timestamp = Column(BigInteger)
l1_batch_number = Column(BigInteger, nullable=True)
l1_batch_timestamp = Column(BigInteger, nullable=True)
class ZkSyncEraTestnetTransaction(Base): # type: ignore
@ -677,8 +677,8 @@ class ZkSyncEraTestnetTransaction(Base): # type: ignore
DateTime(timezone=True), server_default=utcnow(), nullable=False
)
l1_batch_number = Column(BigInteger, index=True)
l1_batch_tx_index = Column(BigInteger, index=True)
l1_batch_number = Column(BigInteger, nullable=True)
l1_batch_tx_index = Column(BigInteger, nullable=True)
class ZkSyncEraTestnetLabel(Base): # type: ignore