Bug #22840
closeddb:structure:dump protections in services/api/Rakefile stopped working
Description
In #5677 we started commenting out the "COMMENT ON EXTENSION" bit added by Rails after applying a migration:
-- -- Name: EXTENSION pg_trgm; Type: COMMENT; Schema: -; Owner: - -- COMMENT ON EXTENSION pg_trgm IS 'text similarity measurement and index searching based on trigrams';
But this seems to have stopped working. 30cd7edac00dce5b683b20f4060448476474a1b5 committed this (uncommented) and this causes test-provision jobs to fail.
test-provision-debian12: #331 /consoleText at 0621f5ee12df1776bc22abcf770b8f6c662394c2
psql:/var/www/arvados-api/current/db/structure.sql:27: ERROR: must be owner of extension pg_trgm rake aborted! failed to execute: psql --set ON_ERROR_STOP=1 --quiet --no-psqlrc --output /dev/null --file /var/www/arvados-api/current/db/structure.sql dbn12_arvados
Updated by Tom Clegg 11 months ago
Our hook stopped working because Rails 6.1 started calling it db:schema:dump instead of db:structure:dump.
https://github.com/rails/rails/pull/39470
Fix:
22840-structure-sql @ f02dd5fb44664d24613a9b8ad845f013b553cb92 -- developer-run-tests: #4757
This also re-orders the tables in structure.sql to lexical order. I don't know why 30cd7edac00dce5b683b20f4060448476474a1b5 moved "groups" to the top, but when I run "migrate" to dump the schema, I still get lexical order...
Updated by Peter Amstutz 11 months ago
I don't know either, it kept wanting to move groups to the top so I included it in the commit, but it wasn't necessary for anything.
It was developed using Postgresql 13 on Debian 11 (inside Arvbox). I'm guessing newer Postgresql behaves a bit differently, hopefully better.
Updated by Tom Clegg 11 months ago
- Status changed from In Progress to Resolved
Applied in changeset arvados|48082f1e76e700dd4228bba955edf0b645ddbe03.