Skip to content

Commit d5cfbf9

Browse files
committed
Add coinbase migration
1 parent ac806d2 commit d5cfbf9

File tree

2 files changed

+31
-1
lines changed

2 files changed

+31
-1
lines changed
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
"""Add coinbase to transaction
2+
3+
Revision ID: 321b2954fdf2
4+
Revises: 94324ba323d4
5+
Create Date: 2025-10-18 18:32:39.295802
6+
7+
"""
8+
from typing import Sequence, Union
9+
10+
from alembic import op
11+
import sqlalchemy as sa
12+
13+
14+
# revision identifiers, used by Alembic.
15+
revision: str = '321b2954fdf2'
16+
down_revision: Union[str, None] = '94324ba323d4'
17+
branch_labels: Union[str, Sequence[str], None] = None
18+
depends_on: Union[str, Sequence[str], None] = None
19+
20+
21+
def upgrade() -> None:
22+
# ### commands auto generated by Alembic - please adjust! ###
23+
op.add_column('service_transactions', sa.Column('coinbase', sa.Boolean(), nullable=True))
24+
# ### end Alembic commands ###
25+
26+
27+
def downgrade() -> None:
28+
# ### commands auto generated by Alembic - please adjust! ###
29+
op.drop_column('service_transactions', 'coinbase')
30+
# ### end Alembic commands ###

app/models/transaction.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,4 +30,4 @@ class Transaction(Base):
3030

3131
amount: Mapped[dict[str, float]] = mapped_column(JSONB, default={})
3232

33-
coinbase: Mapped[bool]
33+
coinbase: Mapped[bool] = mapped_column(nullable=True)

0 commit comments

Comments
 (0)