Coverage for opt/mealie/lib/python3.12/site-packages/mealie/alembic/versions/2024-04-07-01.05.20_7788478a0338_add_group_recipe_actions.py: 74%
19 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 03:04 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-10-07 03:04 +0000
1"""add group recipe actions
3Revision ID: 7788478a0338
4Revises: d7c6efd2de42
5Create Date: 2024-04-07 01:05:20.816270
7"""
9import sqlalchemy as sa
10from alembic import op
12import mealie.db.migration_types
14# revision identifiers, used by Alembic.
15revision = "7788478a0338"
16down_revision = "d7c6efd2de42"
17branch_labels: str | tuple[str, ...] | None = None
18depends_on: str | tuple[str, ...] | None = None
21def upgrade():
22 # ### commands auto generated by Alembic - please adjust! ###
23 op.create_table(
24 "recipe_actions",
25 sa.Column("id", mealie.db.migration_types.GUID(), nullable=False),
26 sa.Column("group_id", mealie.db.migration_types.GUID(), nullable=False),
27 sa.Column("action_type", sa.String(), nullable=False),
28 sa.Column("title", sa.String(), nullable=False),
29 sa.Column("url", sa.String(), nullable=False),
30 sa.Column("created_at", sa.DateTime(), nullable=True),
31 sa.Column("update_at", sa.DateTime(), nullable=True),
32 sa.ForeignKeyConstraint(
33 ["group_id"],
34 ["groups.id"],
35 ),
36 sa.PrimaryKeyConstraint("id"),
37 )
38 op.create_index(op.f("ix_recipe_actions_action_type"), "recipe_actions", ["action_type"], unique=False)
39 op.create_index(op.f("ix_recipe_actions_created_at"), "recipe_actions", ["created_at"], unique=False)
40 op.create_index(op.f("ix_recipe_actions_group_id"), "recipe_actions", ["group_id"], unique=False)
41 op.create_index(op.f("ix_recipe_actions_title"), "recipe_actions", ["title"], unique=False)
42 # ### end Alembic commands ###
45def downgrade():
46 # ### commands auto generated by Alembic - please adjust! ###
47 op.drop_index(op.f("ix_recipe_actions_title"), table_name="recipe_actions")
48 op.drop_index(op.f("ix_recipe_actions_group_id"), table_name="recipe_actions")
49 op.drop_index(op.f("ix_recipe_actions_created_at"), table_name="recipe_actions")
50 op.drop_index(op.f("ix_recipe_actions_action_type"), table_name="recipe_actions")
51 op.drop_table("recipe_actions")
52 # ### end Alembic commands ###