Skip to content

Commit

Permalink
Migration command fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MooreTheAnalyst committed Nov 27, 2024
1 parent 70e7cbf commit 16f8402
Showing 1 changed file with 85 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
"""add-new-events-models
Revision ID: c53651eb145e
Revises: 163f616930fb
Create Date: 2024-11-27 17:27:03.992425
"""
from typing import Sequence, Union

from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision: str = 'c53651eb145e'
down_revision: Union[str, None] = '163f616930fb'
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.drop_index('ix_debt_mint_event_block_number', table_name='debt_mint_event')
op.drop_index('ix_debt_mint_event_event_name', table_name='debt_mint_event')
op.drop_table('debt_mint_event')
op.drop_index('ix_debt_burn_event_block_number', table_name='debt_burn_event')
op.drop_index('ix_debt_burn_event_event_name', table_name='debt_burn_event')
op.drop_table('debt_burn_event')
op.drop_index('ix_debt_transfer_event_block_number', table_name='debt_transfer_event')
op.drop_index('ix_debt_transfer_event_event_name', table_name='debt_transfer_event')
op.drop_table('debt_transfer_event')
op.drop_index('ix_bearing_collateral_burn_event_block_number', table_name='bearing_collateral_burn_event')
op.drop_index('ix_bearing_collateral_burn_event_event_name', table_name='bearing_collateral_burn_event')
op.drop_table('bearing_collateral_burn_event')
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('bearing_collateral_burn_event',
sa.Column('user', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('amount', sa.NUMERIC(precision=38, scale=18), autoincrement=False, nullable=False),
sa.Column('event_name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('block_number', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('protocol_id', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='bearing_collateral_burn_event_pkey')
)
op.create_index('ix_bearing_collateral_burn_event_event_name', 'bearing_collateral_burn_event', ['event_name'], unique=False)
op.create_index('ix_bearing_collateral_burn_event_block_number', 'bearing_collateral_burn_event', ['block_number'], unique=False)
op.create_table('debt_transfer_event',
sa.Column('sender', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('recipient', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('amount', sa.NUMERIC(precision=38, scale=18), autoincrement=False, nullable=False),
sa.Column('event_name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('block_number', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('protocol_id', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='debt_transfer_event_pkey')
)
op.create_index('ix_debt_transfer_event_event_name', 'debt_transfer_event', ['event_name'], unique=False)
op.create_index('ix_debt_transfer_event_block_number', 'debt_transfer_event', ['block_number'], unique=False)
op.create_table('debt_burn_event',
sa.Column('user', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('amount', sa.NUMERIC(precision=38, scale=18), autoincrement=False, nullable=False),
sa.Column('event_name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('block_number', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('protocol_id', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='debt_burn_event_pkey')
)
op.create_index('ix_debt_burn_event_event_name', 'debt_burn_event', ['event_name'], unique=False)
op.create_index('ix_debt_burn_event_block_number', 'debt_burn_event', ['block_number'], unique=False)
op.create_table('debt_mint_event',
sa.Column('user', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('amount', sa.NUMERIC(precision=38, scale=18), autoincrement=False, nullable=False),
sa.Column('event_name', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('block_number', sa.INTEGER(), autoincrement=False, nullable=False),
sa.Column('protocol_id', sa.VARCHAR(), autoincrement=False, nullable=False),
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
sa.PrimaryKeyConstraint('id', name='debt_mint_event_pkey')
)
op.create_index('ix_debt_mint_event_event_name', 'debt_mint_event', ['event_name'], unique=False)
op.create_index('ix_debt_mint_event_block_number', 'debt_mint_event', ['block_number'], unique=False)
# ### end Alembic commands ###

0 comments on commit 16f8402

Please sign in to comment.