45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
"""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 ###
|