Coverage for opt/mealie/lib/python3.12/site-packages/mealie/alembic/versions/2022-08-29-13.57.40_44e8d670719d_add_extras_to_shopping_lists_list_items_.py: 80%

15 statements  

« prev     ^ index     » next       coverage.py v7.10.6, created at 2025-12-05 13:45 +0000

1"""add extras to shopping lists, list items, and ingredient foods 

2 

3Revision ID: 44e8d670719d 

4Revises: 089bfa50d0ed 

5Create Date: 2022-08-29 13:57:40.452245 

6 

7""" 

8 

9import sqlalchemy as sa 1a

10 

11import mealie.db.migration_types 1a

12from alembic import op 1a

13 

14# revision identifiers, used by Alembic. 

15revision = "44e8d670719d" 1a

16down_revision = "089bfa50d0ed" 1a

17branch_labels: str | tuple[str, ...] | None = None 1a

18depends_on: str | tuple[str, ...] | None = None 1a

19 

20 

21def upgrade(): 1a

22 # ### commands auto generated by Alembic - please adjust! ### 

23 op.create_table( 1a

24 "shopping_list_extras", 

25 sa.Column("created_at", sa.DateTime(), nullable=True), 

26 sa.Column("update_at", sa.DateTime(), nullable=True), 

27 sa.Column("id", sa.Integer(), nullable=False), 

28 sa.Column("key_name", sa.String(), nullable=True), 

29 sa.Column("value", sa.String(), nullable=True), 

30 sa.Column("shopping_list_id", mealie.db.migration_types.GUID(), nullable=True), 

31 sa.ForeignKeyConstraint( 

32 ["shopping_list_id"], 

33 ["shopping_lists.id"], 

34 ), 

35 sa.PrimaryKeyConstraint("id"), 

36 ) 

37 op.create_table( 1a

38 "ingredient_food_extras", 

39 sa.Column("created_at", sa.DateTime(), nullable=True), 

40 sa.Column("update_at", sa.DateTime(), nullable=True), 

41 sa.Column("id", sa.Integer(), nullable=False), 

42 sa.Column("key_name", sa.String(), nullable=True), 

43 sa.Column("value", sa.String(), nullable=True), 

44 sa.Column("ingredient_food_id", mealie.db.migration_types.GUID(), nullable=True), 

45 sa.ForeignKeyConstraint( 

46 ["ingredient_food_id"], 

47 ["ingredient_foods.id"], 

48 ), 

49 sa.PrimaryKeyConstraint("id"), 

50 ) 

51 op.create_table( 1a

52 "shopping_list_item_extras", 

53 sa.Column("created_at", sa.DateTime(), nullable=True), 

54 sa.Column("update_at", sa.DateTime(), nullable=True), 

55 sa.Column("id", sa.Integer(), nullable=False), 

56 sa.Column("key_name", sa.String(), nullable=True), 

57 sa.Column("value", sa.String(), nullable=True), 

58 sa.Column("shopping_list_item_id", mealie.db.migration_types.GUID(), nullable=True), 

59 sa.ForeignKeyConstraint( 

60 ["shopping_list_item_id"], 

61 ["shopping_list_items.id"], 

62 ), 

63 sa.PrimaryKeyConstraint("id"), 

64 ) 

65 # ### end Alembic commands ### 

66 

67 

68def downgrade(): 1a

69 # ### commands auto generated by Alembic - please adjust! ### 

70 op.drop_table("shopping_list_item_extras") 

71 op.drop_table("ingredient_food_extras") 

72 op.drop_table("shopping_list_extras") 

73 # ### end Alembic commands ###