Skip to content

Commit

Permalink
update db setting
Browse files Browse the repository at this point in the history
  • Loading branch information
motty-mio2 committed Nov 16, 2023
1 parent 4894f15 commit 6723b5b
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
33 changes: 33 additions & 0 deletions src/alembic/versions/2023_11_16_2220-6846ef0ccd9a_.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
"""empty message
Revision ID: 6846ef0ccd9a
Revises: 861f09faff9c
Create Date: 2023-11-16 22:20:36.556485
"""
from typing import Sequence, Union

import sqlalchemy as sa

from alembic import op


# revision identifiers, used by Alembic.
revision: str = "6846ef0ccd9a"
down_revision: Union[str, None] = "861f09faff9c"
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.alter_column("session", "device_id", existing_type=sa.INTEGER(), nullable=False)
op.add_column("shoe", sa.Column("image_url", sa.String(), nullable=False))
# ### end Alembic commands ###


def downgrade() -> None:
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("shoe", "image_url")
op.alter_column("session", "device_id", existing_type=sa.INTEGER(), nullable=True)
# ### end Alembic commands ###
2 changes: 1 addition & 1 deletion src/kb_2315/backend/models/model_shoe.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@
class Shoe(Base):
id: Mapped[int] = mapped_column(Integer, primary_key=True)
name: Mapped[str] = mapped_column(String, default="Shoe")
image_url: Mapped[str] = mapped_column(String, )
image_url: Mapped[str] = mapped_column(String, nullable=True)

sessions: Mapped[list[Session]] = relationship("Session", backref="event")

0 comments on commit 6723b5b

Please sign in to comment.