Skip to content

Commit

Permalink
[CON-177] Add new column is_available to tracks table (#3163)
Browse files Browse the repository at this point in the history
* add new column is_available to tracks table

* actually it's lowercase true not uppercase oo000ps
  • Loading branch information
vicky-g authored May 26, 2022
1 parent 389275c commit 8f412bf
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
"""add is_available column to track table
Revision ID: 5e17e0480ca7
Revises: a83814aeb4a1
Create Date: 2022-05-20 21:55:56.464788
"""
import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "5e17e0480ca7"
down_revision = "a83814aeb4a1"
branch_labels = None
depends_on = None


def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column(
"tracks",
sa.Column("is_available", sa.Boolean(), nullable=False, server_default="true"),
)
# ### end Alembic commands ###


def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("tracks", "is_available")
# ### end Alembic commands ###
2 changes: 2 additions & 0 deletions discovery-provider/src/models/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,7 @@ class Track(Base):
is_unlisted = Column(Boolean, nullable=False)
field_visibility = Column(postgresql.JSONB, nullable=True)
stem_of = Column(postgresql.JSONB, nullable=True)
is_available = Column(Boolean, default=True, nullable=False)

_routes = relationship( # type: ignore
"TrackRoute",
Expand Down Expand Up @@ -390,6 +391,7 @@ def __repr__(self):
f"stem_of={self.stem_of},"
f"permalink={self.permalink},"
f"user={self.user}"
f"is_available={self.is_available}"
")>"
)

Expand Down

0 comments on commit 8f412bf

Please sign in to comment.