complete trigger rework; update SwapOrderStatus with Andrew's changes; not fully debugged
This commit is contained in:
@@ -72,7 +72,7 @@ def upgrade() -> None:
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('chain', dexorder.database.column_types.Blockchain(), nullable=False),
|
||||
sa.Column('height', sa.Integer(), nullable=False),
|
||||
sa.Column('state', sa.Enum('Requested', 'Signed', 'Sent', 'Mined', name='transactionjobstate'), nullable=False),
|
||||
sa.Column('state', sa.Enum('Requested', 'Signed', 'Sent', 'Mined', 'Error', name='transactionjobstate'), nullable=False),
|
||||
sa.Column('request', dexorder.database.column_types.DataclassDictBase(astext_type=sa.Text()), nullable=False),
|
||||
sa.Column('tx_id', postgresql.BYTEA(), nullable=True),
|
||||
sa.Column('tx_data', postgresql.BYTEA(), nullable=True),
|
||||
@@ -83,10 +83,24 @@ def upgrade() -> None:
|
||||
op.create_index(op.f('ix_transactionjob_height'), 'transactionjob', ['height'], unique=False)
|
||||
op.create_index(op.f('ix_transactionjob_state'), 'transactionjob', ['state'], unique=False)
|
||||
op.create_index(op.f('ix_transactionjob_tx_id'), 'transactionjob', ['tx_id'], unique=False)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
op.create_table('dbblock',
|
||||
sa.Column('chain', dexorder.database.column_types.Blockchain(), nullable=False),
|
||||
sa.Column('hash', postgresql.BYTEA(), nullable=False),
|
||||
sa.Column('height', sa.Integer(), nullable=False),
|
||||
sa.Column('timestamp', sa.INTEGER(), nullable=False),
|
||||
sa.Column('confirmed', sa.Boolean(), nullable=False),
|
||||
sa.Column('data', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.PrimaryKeyConstraint('chain', 'hash')
|
||||
)
|
||||
op.create_index(op.f('ix_dbblock_height'), 'dbblock', ['height'], unique=False)
|
||||
op.create_index(op.f('ix_dbblock_timestamp'), 'dbblock', ['timestamp'], unique=False)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
op.drop_index(op.f('ix_dbblock_timestamp'), table_name='dbblock')
|
||||
op.drop_index(op.f('ix_dbblock_height'), table_name='dbblock')
|
||||
op.drop_table('dbblock')
|
||||
op.drop_index(op.f('ix_transactionjob_tx_id'), table_name='transactionjob')
|
||||
op.drop_index(op.f('ix_transactionjob_state'), table_name='transactionjob')
|
||||
op.drop_index(op.f('ix_transactionjob_height'), table_name='transactionjob')
|
||||
|
||||
Reference in New Issue
Block a user