fix: BUG-073 (broken imports), BUG-009 (contact folders id=None), BUG-014 (tags assign 500), BUG-016 (search performance use_ai), BUG-030 (user delete GRANT DELETE), BUG-052 (miniapps response), BUG-047 (approval_requests columns), BUG-037 (compliance refresh), prestart.sh GRANT DELETE
Check Cross-Plugin Imports / check (push) Has been cancelled
Check Cross-Plugin Imports / check (push) Has been cancelled
This commit is contained in:
+30
@@ -70,6 +70,36 @@ PYEOF
|
||||
python3 /tmp/set_role_passwords.py
|
||||
rm -f /tmp/set_role_passwords.py
|
||||
|
||||
# Grant DELETE on all tables to crm_api, crm_auth, crm_worker (BUG-030 fix)
|
||||
echo "[prestart] Granting DELETE on all tables to crm_api, crm_auth, crm_worker..."
|
||||
python3 -c "
|
||||
import asyncio, os
|
||||
from sqlalchemy.ext.asyncio import create_async_engine
|
||||
from sqlalchemy import text
|
||||
|
||||
async def grant_delete():
|
||||
db_url = os.environ.get('MIGRATION_DATABASE_URL', os.environ.get('DATABASE_URL', ''))
|
||||
if not db_url:
|
||||
print('[prestart] No DATABASE_URL found, skipping GRANT DELETE')
|
||||
return
|
||||
engine = create_async_engine(db_url)
|
||||
try:
|
||||
async with engine.begin() as conn:
|
||||
for role in ['crm_api', 'crm_auth', 'crm_worker']:
|
||||
try:
|
||||
await conn.execute(text(f'GRANT DELETE ON ALL TABLES IN SCHEMA public TO {role}'))
|
||||
print(f'[prestart] GRANT DELETE to {role} OK')
|
||||
except Exception as e:
|
||||
print(f'[prestart] WARNING: Could not GRANT DELETE to {role}: {e}')
|
||||
print('[prestart] GRANT DELETE complete.')
|
||||
except Exception as e:
|
||||
print(f'[prestart] WARNING: Could not GRANT DELETE: {e}')
|
||||
finally:
|
||||
await engine.dispose()
|
||||
|
||||
asyncio.run(grant_delete())
|
||||
"
|
||||
|
||||
# Set crm_runtime password if RUNTIME_DB_PASSWORD is set (legacy support)
|
||||
if [ -n "$RUNTIME_DB_PASSWORD" ]; then
|
||||
echo "[prestart] Setting crm_runtime password..."
|
||||
|
||||
Reference in New Issue
Block a user