Trip: Archive review model

This commit is contained in:
itskovacs 2025-10-09 19:06:21 +02:00
parent f3b336592e
commit c5c2f76c88
2 changed files with 35 additions and 0 deletions

View File

@ -0,0 +1,33 @@
"""Trip Archival Review
Revision ID: 4f837664b686
Revises: 23320f01d8ce
Create Date: 2025-10-09 19:02:32.979368
"""
from alembic import op
import sqlalchemy as sa
import sqlmodel.sql.sqltypes
# revision identifiers, used by Alembic.
revision = '4f837664b686'
down_revision = '23320f01d8ce'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('trip', schema=None) as batch_op:
batch_op.add_column(sa.Column('archival_review', sqlmodel.sql.sqltypes.AutoString(), nullable=True))
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
with op.batch_alter_table('trip', schema=None) as batch_op:
batch_op.drop_column('archival_review')
# ### end Alembic commands ###

View File

@ -252,6 +252,7 @@ class TripBase(SQLModel):
archived: bool | None = None
currency: str | None = settings.DEFAULT_CURRENCY
notes: str | None = None
archival_review: str | None = None
class Trip(TripBase, table=True):
@ -327,6 +328,7 @@ class TripRead(TripBase):
shared=bool(obj.shares),
currency=obj.currency if obj.currency else settings.DEFAULT_CURRENCY,
notes=obj.notes,
archival_review=obj.archival_review
)