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

feat: recipe timeline backend api (#1685)

* added recipe_timeline_events table to db

* added schema and routes for recipe timeline events

* added missing mixin and fixed update schema

* added tests

* adjusted migration revision tree

* updated alembic revision test

* added initial timeline event for new recipes

* added additional tests

* added event bus support

* renamed event_dt to timestamp

* add timeline_events to ignore list

* run code-gen

* use new test routes implementation

* use doc string syntax

* moved event type enum from db to schema

Co-authored-by: Hayden <64056131+hay-kot@users.noreply.github.com>
This commit is contained in:
Michael Genson 2022-11-01 03:12:26 -05:00 committed by GitHub
parent 714a080ecb
commit 6ee64535df
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 639 additions and 6 deletions

View file

@ -1,7 +1,7 @@
"""Add is_ocr_recipe column to recipes
Revision ID: 089bfa50d0ed
Revises: f30cf048c228
Revises: 188374910655
Create Date: 2022-08-05 17:07:07.389271
"""

View file

@ -1,7 +1,7 @@
"""add extras to shopping lists, list items, and ingredient foods
Revision ID: 44e8d670719d
Revises: 188374910655
Revises: 089bfa50d0ed
Create Date: 2022-08-29 13:57:40.452245
"""

View file

@ -0,0 +1,50 @@
"""add recipe_timeline_events table
Revision ID: 2ea7a807915c
Revises: 44e8d670719d
Create Date: 2022-09-27 14:53:14.111054
"""
import sqlalchemy as sa
import mealie.db.migration_types
from alembic import op
# revision identifiers, used by Alembic.
revision = "2ea7a807915c"
down_revision = "44e8d670719d"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table(
"recipe_timeline_events",
sa.Column("created_at", sa.DateTime(), nullable=True),
sa.Column("update_at", sa.DateTime(), nullable=True),
sa.Column("id", mealie.db.migration_types.GUID(), nullable=False),
sa.Column("recipe_id", mealie.db.migration_types.GUID(), nullable=False),
sa.Column("user_id", mealie.db.migration_types.GUID(), nullable=False),
sa.Column("subject", sa.String(), nullable=False),
sa.Column("message", sa.String(), nullable=True),
sa.Column("event_type", sa.String(), nullable=True),
sa.Column("image", sa.String(), nullable=True),
sa.Column("timestamp", sa.DateTime(), nullable=True),
sa.ForeignKeyConstraint(
["recipe_id"],
["recipes.id"],
),
sa.ForeignKeyConstraint(
["user_id"],
["users.id"],
),
sa.PrimaryKeyConstraint("id"),
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table("recipe_timeline_events")
# ### end Alembic commands ###