mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2025-12-23 22:18:19 -05:00
add score field to db table and add alembic migration for the field
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
"""Add score field to IndexerQueryResult table
|
||||
|
||||
Revision ID: 5299dfed220b
|
||||
Revises: 1801d9f5a275
|
||||
Create Date: 2025-07-16 23:24:37.931188
|
||||
|
||||
"""
|
||||
|
||||
from typing import Sequence, Union
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision: str = "5299dfed220b"
|
||||
down_revision: Union[str, None] = "1801d9f5a275"
|
||||
branch_labels: Union[str, Sequence[str], None] = None
|
||||
depends_on: Union[str, Sequence[str], None] = None
|
||||
|
||||
|
||||
def upgrade() -> None:
|
||||
"""Upgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column(
|
||||
"indexer_query_result",
|
||||
sa.Column("score", sa.Integer(), nullable=False, server_default=sa.text("0")),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade() -> None:
|
||||
"""Downgrade schema."""
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column("indexer_query_result", "score")
|
||||
# ### end Alembic commands ###
|
||||
@@ -21,3 +21,4 @@ class IndexerQueryResult(Base):
|
||||
size = mapped_column(BigInteger)
|
||||
usenet: Mapped[bool]
|
||||
age: Mapped[int]
|
||||
score: Mapped[int] = mapped_column(default=0)
|
||||
|
||||
Reference in New Issue
Block a user