bemade-addons/openwebui_integration/migrations/18.0.1.0.1/pre-migration.py
2025-02-18 08:55:21 -05:00

17 lines
550 B
Python

def migrate(cr, version):
"""Add products_per_request column to res_company table."""
if not version:
return
# Add products_per_request column if it doesn't exist
cr.execute("""
SELECT column_name
FROM information_schema.columns
WHERE table_name='res_company'
AND column_name='openwebui_products_per_request'
""")
if not cr.fetchone():
cr.execute("""
ALTER TABLE res_company
ADD COLUMN openwebui_products_per_request integer DEFAULT 10
""")