Coverage for opt/mealie/lib/python3.12/site-packages/mealie/alembic/versions/2022-06-01-11.12.06_ab0bae02578f_add_use_abbreviation_column_to_.py: 91%
11 statements
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 13:45 +0000
« prev ^ index » next coverage.py v7.10.6, created at 2025-12-05 13:45 +0000
1"""Add use_abbreviation column to ingredients
3Revision ID: ab0bae02578f
4Revises: 09dfc897ad62
5Create Date: 2022-06-01 11:12:06.748383
7"""
9import sqlalchemy as sa 1a
11from alembic import op 1a
13# revision identifiers, used by Alembic.
14revision = "ab0bae02578f" 1a
15down_revision = "09dfc897ad62" 1a
16branch_labels: str | tuple[str, ...] | None = None 1a
17depends_on: str | tuple[str, ...] | None = None 1a
20def upgrade(): 1a
21 # ### commands auto generated by Alembic - please adjust! ###
22 op.add_column("ingredient_units", sa.Column("use_abbreviation", sa.Boolean(), nullable=True)) 1a
24 op.execute("UPDATE ingredient_units SET use_abbreviation = FALSE WHERE use_abbreviation IS NULL") 1a
25 # ### end Alembic commands ###
28def downgrade(): 1a
29 # ### commands auto generated by Alembic - please adjust! ###
30 op.drop_column("ingredient_units", "use_abbreviation")
31 # ### end Alembic commands ###