-
Notifications
You must be signed in to change notification settings - Fork 184
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Add default blocklist to user when created - Tags are created if added to a user blocklist - Add matching migration to DB to add the user blocklist table - Various other things
- Loading branch information
Showing
9 changed files
with
220 additions
and
9 deletions.
There are no files selected for viewing
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
30 changes: 30 additions & 0 deletions
30
server/szurubooru/migrations/versions/9ba5e3a6ee7c_add_blocklist.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,30 @@ | ||
''' | ||
Add blocklist related fields | ||
add_blocklist | ||
Revision ID: 9ba5e3a6ee7c | ||
Created at: 2023-05-20 22:28:10.824954 | ||
''' | ||
|
||
import sqlalchemy as sa | ||
from alembic import op | ||
|
||
revision = '9ba5e3a6ee7c' | ||
down_revision = 'adcd63ff76a2' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
|
||
def upgrade(): | ||
op.create_table( | ||
"user_tag_blocklist", | ||
sa.Column("user_id", sa.Integer(), nullable=False), | ||
sa.Column("tag_id", sa.Integer(), nullable=False), | ||
sa.ForeignKeyConstraint(["user_id"], ["user.id"]), | ||
sa.ForeignKeyConstraint(["tag_id"], ["tag.id"]), | ||
sa.PrimaryKeyConstraint("user_id", "tag_id"), | ||
) | ||
|
||
def downgrade(): | ||
op.drop_table('user_tag_blocklist') |
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