added alembic revision and updated gitignore

This commit is contained in:
Tim Olson
2023-09-21 17:31:20 -04:00
parent 0ff6a1ae0b
commit 79cd65a289
2 changed files with 47 additions and 2 deletions

5
.gitignore vendored
View File

@@ -1,5 +1,6 @@
venv/
venv
*secret*
dexorder.toml
./contract
/contract
.idea
__pycache__

View File

@@ -0,0 +1,44 @@
"""empty message
Revision ID: 1da309899f95
Revises:
Create Date: 2023-09-18 19:18:11.706312
"""
from typing import Sequence, Union
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
# revision identifiers, used by Alembic.
revision: str = '1da309899f95'
down_revision: Union[str, None] = None
branch_labels: Union[str, Sequence[str], None] = None
depends_on: Union[str, Sequence[str], None] = None
def upgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('block',
sa.Column('chain', sa.Integer(), nullable=False),
sa.Column('height', sa.Integer(), nullable=False),
sa.Column('hash', sa.LargeBinary(), nullable=False),
sa.Column('parent', sa.LargeBinary(), nullable=False),
sa.Column('data', postgresql.JSONB(astext_type=sa.Text()), nullable=False),
sa.PrimaryKeyConstraint('chain', 'height', 'hash')
)
op.drop_table('migrations')
# ### end Alembic commands ###
def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('migrations',
sa.Column('id', sa.INTEGER(), autoincrement=True, nullable=False),
sa.Column('name', sa.VARCHAR(length=255), autoincrement=False, nullable=False),
sa.Column('run_on', postgresql.TIMESTAMP(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='migrations_pkey')
)
op.drop_table('block')
# ### end Alembic commands ###