Fix HTML rendering for service descriptions, allow zero price for services, improve image_url handling
This commit is contained in:
20
backend/drop_constraints.py
Normal file
20
backend/drop_constraints.py
Normal file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Drop price check constraints from database"""
|
||||
import asyncio
|
||||
from database import async_engine
|
||||
from sqlalchemy import text
|
||||
|
||||
async def drop_constraints():
|
||||
async with async_engine.begin() as conn:
|
||||
# Drop services price constraint
|
||||
result1 = await conn.execute(text('ALTER TABLE services DROP CONSTRAINT IF EXISTS chk_services_price_positive'))
|
||||
print('Dropped chk_services_price_positive')
|
||||
|
||||
# Drop products price constraint
|
||||
result2 = await conn.execute(text('ALTER TABLE products DROP CONSTRAINT IF EXISTS chk_products_price_positive'))
|
||||
print('Dropped chk_products_price_positive')
|
||||
|
||||
print('Done!')
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(drop_constraints())
|
||||
Reference in New Issue
Block a user