mirror of
https://github.com/maxdorninger/MediaManager.git
synced 2026-04-17 15:13:24 +02:00
This PR removes the requests feature. The functionality will be replaced either by Seerr or by reimplementing it in a better way.
66 lines
3.6 KiB
Python
66 lines
3.6 KiB
Python
"""remove requests
|
|
|
|
Revision ID: e60ae827ed98
|
|
Revises: a6f714d3c8b9
|
|
Create Date: 2026-02-22 18:07:12.866130
|
|
|
|
"""
|
|
from typing import Sequence, Union
|
|
|
|
from alembic import op
|
|
import sqlalchemy as sa
|
|
from sqlalchemy.dialects import postgresql
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision: str = 'e60ae827ed98'
|
|
down_revision: Union[str, None] = 'a6f714d3c8b9'
|
|
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.drop_table('movie_request')
|
|
op.drop_table('season_request')
|
|
op.alter_column('episode', 'overview',
|
|
existing_type=sa.TEXT(),
|
|
type_=sa.String(),
|
|
existing_nullable=True)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade() -> None:
|
|
"""Downgrade schema."""
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
|
|
op.create_table('season_request',
|
|
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('season_id', sa.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('wanted_quality', postgresql.ENUM('uhd', 'fullhd', 'hd', 'sd', 'unknown', name='quality'), autoincrement=False, nullable=False),
|
|
sa.Column('min_quality', postgresql.ENUM('uhd', 'fullhd', 'hd', 'sd', 'unknown', name='quality'), autoincrement=False, nullable=False),
|
|
sa.Column('requested_by_id', sa.UUID(), autoincrement=False, nullable=True),
|
|
sa.Column('authorized', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
|
sa.Column('authorized_by_id', sa.UUID(), autoincrement=False, nullable=True),
|
|
sa.ForeignKeyConstraint(['authorized_by_id'], ['user.id'], name=op.f('season_request_authorized_by_id_fkey'), ondelete='SET NULL'),
|
|
sa.ForeignKeyConstraint(['requested_by_id'], ['user.id'], name=op.f('season_request_requested_by_id_fkey'), ondelete='SET NULL'),
|
|
sa.ForeignKeyConstraint(['season_id'], ['season.id'], name=op.f('season_request_season_id_fkey'), ondelete='CASCADE'),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('season_request_pkey')),
|
|
sa.UniqueConstraint('season_id', 'wanted_quality', name=op.f('season_request_season_id_wanted_quality_key'), postgresql_include=[], postgresql_nulls_not_distinct=False)
|
|
)
|
|
op.create_table('movie_request',
|
|
sa.Column('id', sa.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('movie_id', sa.UUID(), autoincrement=False, nullable=False),
|
|
sa.Column('wanted_quality', postgresql.ENUM('uhd', 'fullhd', 'hd', 'sd', 'unknown', name='quality'), autoincrement=False, nullable=False),
|
|
sa.Column('min_quality', postgresql.ENUM('uhd', 'fullhd', 'hd', 'sd', 'unknown', name='quality'), autoincrement=False, nullable=False),
|
|
sa.Column('authorized', sa.BOOLEAN(), autoincrement=False, nullable=False),
|
|
sa.Column('requested_by_id', sa.UUID(), autoincrement=False, nullable=True),
|
|
sa.Column('authorized_by_id', sa.UUID(), autoincrement=False, nullable=True),
|
|
sa.ForeignKeyConstraint(['authorized_by_id'], ['user.id'], name=op.f('movie_request_authorized_by_id_fkey'), ondelete='SET NULL'),
|
|
sa.ForeignKeyConstraint(['movie_id'], ['movie.id'], name=op.f('movie_request_movie_id_fkey'), ondelete='CASCADE'),
|
|
sa.ForeignKeyConstraint(['requested_by_id'], ['user.id'], name=op.f('movie_request_requested_by_id_fkey'), ondelete='SET NULL'),
|
|
sa.PrimaryKeyConstraint('id', name=op.f('movie_request_pkey')),
|
|
sa.UniqueConstraint('movie_id', 'wanted_quality', name=op.f('movie_request_movie_id_wanted_quality_key'), postgresql_include=[], postgresql_nulls_not_distinct=False)
|
|
)
|
|
# ### end Alembic commands ###
|