Coverage for opt/mealie/lib/python3.12/site-packages/mealie/alembic/versions/2022-09-27-14.53.14_2ea7a807915c_add_recipe_timeline_events_table.py: 91%
11 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 15:32 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 15:32 +0000
1"""add recipe_timeline_events table
3Revision ID: 2ea7a807915c
4Revises: 44e8d670719d
5Create Date: 2022-09-27 14:53:14.111054
7"""
9import sqlalchemy as sa 1a
11import mealie.db.migration_types 1a
12from alembic import op 1a
14# revision identifiers, used by Alembic.
15revision = "2ea7a807915c" 1a
16down_revision = "44e8d670719d" 1a
17branch_labels: str | tuple[str, ...] | None = None 1a
18depends_on: str | tuple[str, ...] | None = None 1a
21def upgrade(): 1a
22 # ### commands auto generated by Alembic - please adjust! ###
23 op.create_table( 1a
24 "recipe_timeline_events",
25 sa.Column("created_at", sa.DateTime(), nullable=True),
26 sa.Column("update_at", sa.DateTime(), nullable=True),
27 sa.Column("id", mealie.db.migration_types.GUID(), nullable=False),
28 sa.Column("recipe_id", mealie.db.migration_types.GUID(), nullable=False),
29 sa.Column("user_id", mealie.db.migration_types.GUID(), nullable=False),
30 sa.Column("subject", sa.String(), nullable=False),
31 sa.Column("message", sa.String(), nullable=True),
32 sa.Column("event_type", sa.String(), nullable=True),
33 sa.Column("image", sa.String(), nullable=True),
34 sa.Column("timestamp", sa.DateTime(), nullable=True),
35 sa.ForeignKeyConstraint(
36 ["recipe_id"],
37 ["recipes.id"],
38 ),
39 sa.ForeignKeyConstraint(
40 ["user_id"],
41 ["users.id"],
42 ),
43 sa.PrimaryKeyConstraint("id"),
44 )
45 # ### end Alembic commands ###
48def downgrade(): 1a
49 # ### commands auto generated by Alembic - please adjust! ###
50 op.drop_table("recipe_timeline_events")
51 # ### end Alembic commands ###