mirror of
https://github.com/dartdavros/chatballs.git
synced 2026-10-05 09:14:58 +03:00
Production deploy failed at migrate with «must be owner of table identity_organization»: the table (and others created/imported outside the migration role) were not owned by custocrm_schema, which migration_user must belong to to run AddField/AlterField. This is a pre-existing condition that surfaced on the administration migration and recurred across pipelines (#922, #937, #938) — not caused by the calls feature. Fix makes deploy self-healing: before running migrate, reassign ownership of all public-schema objects (tables, sequences, functions) to custocrm_schema under the postgres superuser. Idempotent and safe on every deploy. - deploy/postgres/reassign-schema-ownership.sql: reassign public-schema ownership to custocrm_schema (verified against PG16) - compose.yaml: mount the SQL into the postgres container - deploy/cli/lib/deploy.sh: run the normalization step once postgres is healthy, before the one-shot migrate