-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Works can be suppressed at the library level.
- Loading branch information
1 parent
1d8c2b1
commit 1be90db
Showing
12 changed files
with
446 additions
and
3 deletions.
There are no files selected for viewing
31 changes: 31 additions & 0 deletions
31
alembic/versions/20240216_9d2dccb0d6ff_ability_to_suppress_works_per_library.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
"""Ability to suppress works per library | ||
Revision ID: 9d2dccb0d6ff | ||
Revises: 1c9f519415b5 | ||
Create Date: 2024-02-16 17:08:52.146860+00:00 | ||
""" | ||
import sqlalchemy as sa | ||
|
||
from alembic import op | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = "9d2dccb0d6ff" | ||
down_revision = "1c9f519415b5" | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade() -> None: | ||
op.create_table( | ||
"work_library_suppressions", | ||
sa.Column("work_id", sa.Integer(), nullable=False), | ||
sa.Column("library_id", sa.Integer(), nullable=False), | ||
sa.ForeignKeyConstraint(["library_id"], ["libraries.id"], ondelete="CASCADE"), | ||
sa.ForeignKeyConstraint(["work_id"], ["works.id"], ondelete="CASCADE"), | ||
sa.PrimaryKeyConstraint("work_id", "library_id"), | ||
) | ||
|
||
|
||
def downgrade() -> None: | ||
op.drop_table("work_library_suppressions") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/usr/bin/env python | ||
import os | ||
import sys | ||
|
||
bin_dir = os.path.split(__file__)[0] | ||
package_dir = os.path.join(bin_dir, "..", "..") | ||
sys.path.append(os.path.abspath(package_dir)) | ||
from core.scripts import SuppressWorkForLibraryScript | ||
|
||
SuppressWorkForLibraryScript().run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.