1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 04:25:24 +02:00

feat: support require_all property for cookbooks (#1130)

* add direction prop for icon position

* add support for require_all properties on cookbook

* update type annotations

* add and - or filter support

* update cookbook API

* generate types

* implement editor for additional options

* update version number
This commit is contained in:
Hayden 2022-04-03 16:32:58 -08:00 committed by GitHub
parent c988de1921
commit 10784b6e24
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
12 changed files with 129 additions and 13 deletions

View file

@ -0,0 +1,45 @@
"""add require_all for cookbook filters
Revision ID: 09dfc897ad62
Revises: 59eb59135381
Create Date: 2022-04-03 10:48:51.379968
"""
import sqlalchemy as sa
import mealie.db.migration_types # noqa: F401
from alembic import op
# revision identifiers, used by Alembic.
revision = "09dfc897ad62"
down_revision = "59eb59135381"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.add_column("cookbooks", sa.Column("require_all_categories", sa.Boolean(), nullable=True))
op.add_column("cookbooks", sa.Column("require_all_tags", sa.Boolean(), nullable=True))
op.add_column("cookbooks", sa.Column("require_all_tools", sa.Boolean(), nullable=True))
# Set Defaults for Existing Cookbooks
op.execute(
"""
UPDATE cookbooks
SET require_all_categories = TRUE,
require_all_tags = TRUE,
require_all_tools = TRUE
"""
)
# ### end Alembic commands ###
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_column("cookbooks", "require_all_tools")
op.drop_column("cookbooks", "require_all_tags")
op.drop_column("cookbooks", "require_all_categories")
# ### end Alembic commands ###