db-based transaction management; checkin for juan
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
"""empty message
|
||||
"""
|
||||
initial schema
|
||||
|
||||
Revision ID: db62e7db828d
|
||||
Revises:
|
||||
Create Date: 2023-09-28 23:04:41.020644
|
||||
|
||||
"""
|
||||
from typing import Sequence, Union
|
||||
|
||||
@@ -46,6 +46,25 @@ def upgrade() -> None:
|
||||
sa.Column('key', sa.String(), nullable=False),
|
||||
sa.PrimaryKeyConstraint('chain', 'series', 'key')
|
||||
)
|
||||
op.create_table('transactionjob',
|
||||
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('completed', sa.Boolean(), nullable=False),
|
||||
sa.Column('request', dexorder.database.column_types._DataclassDict(astext_type=sa.Text()), nullable=False),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
op.create_index(op.f('ix_transactionjob_chain'), 'transactionjob', ['chain'], unique=False)
|
||||
op.create_index(op.f('ix_transactionjob_completed'), 'transactionjob', ['completed'], unique=False)
|
||||
op.create_index(op.f('ix_transactionjob_height'), 'transactionjob', ['height'], unique=False)
|
||||
op.create_table('tx',
|
||||
sa.Column('id', sa.UUID(), nullable=False),
|
||||
sa.Column('tx', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.Column('hash', postgresql.BYTEA(), nullable=False),
|
||||
sa.Column('receipt', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
|
||||
sa.ForeignKeyConstraint(['id'], ['transactionjob.id'], ),
|
||||
sa.PrimaryKeyConstraint('id')
|
||||
)
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
@@ -53,3 +72,5 @@ def downgrade() -> None:
|
||||
op.drop_table('seriesdict')
|
||||
op.drop_table('keyvalue')
|
||||
op.drop_table('block')
|
||||
op.drop_table('tx')
|
||||
op.drop_table('transactionjob')
|
||||
Reference in New Issue
Block a user