mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-03 04:25:24 +02:00
Fix/incorrect quantity column (#1093)
* change database type * database migration for changing type on PostgreSQL * update revision * add exclusion directory * update recipe-scrapers
This commit is contained in:
parent
7895dfba70
commit
b57e42a3b3
6 changed files with 68 additions and 13 deletions
|
@ -0,0 +1,51 @@
|
|||
"""convert quantity from integer to float
|
||||
|
||||
Revision ID: 263dd6707191
|
||||
Revises: 6b0f5f32d602
|
||||
Create Date: 2022-03-23 17:43:34.727829
|
||||
|
||||
"""
|
||||
import sqlalchemy as sa
|
||||
|
||||
from alembic import op
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = "263dd6707191"
|
||||
down_revision = "6b0f5f32d602"
|
||||
branch_labels = None
|
||||
depends_on = None
|
||||
|
||||
|
||||
def is_postgres():
|
||||
return op.get_context().dialect.name == "postgresql"
|
||||
|
||||
|
||||
def upgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
# SQLite doesn't require migration as types are not inforced.
|
||||
# Postgres Specifc Migration
|
||||
if is_postgres():
|
||||
op.alter_column(
|
||||
"recipes_ingredients",
|
||||
"quantity",
|
||||
type_=sa.Float(),
|
||||
existing_type=sa.Integer(),
|
||||
)
|
||||
# ### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
# ### commands auto generated by Alembic - please adjust! ###
|
||||
|
||||
# SQLite doesn't require migration as types are not inforced.
|
||||
# Postgres Specifc Migration
|
||||
if is_postgres():
|
||||
op.alter_column(
|
||||
"recipes_ingredients",
|
||||
"quantity",
|
||||
type_=sa.Integer(),
|
||||
existing_type=sa.Float(),
|
||||
)
|
||||
|
||||
# ### end Alembic commands ###
|
Loading…
Add table
Add a link
Reference in a new issue