books migration: only call meta.sync() when permitted; deploy runs it as the app role
All checks were successful
Deploy production / deploy (push) Successful in 2m35s
All checks were successful
Deploy production / deploy (push) Successful in 2m35s
Run #77 failed in db-migrate with "permission denied for function sync": in prod meta.sync() is granted to personal_app/personal_ddl, not to the schema owner (personal) that runs migrations. The migration still registers the books tables in meta.tables and syncs when it can (dev); deploy-remote.sh now runs scripts/db-meta-sync.ts as DB_URL after migrating. Verified on a prod clone with SET ROLE personal / personal_app.
This commit is contained in:
@@ -170,7 +170,11 @@ BEGIN
|
||||
('books','shelves','books-shelves','Book shelves','core',true,false,1000),
|
||||
('books','files','books-files','Book files','core',false,false,1000)
|
||||
ON CONFLICT DO NOTHING;
|
||||
PERFORM meta.sync();
|
||||
-- meta.sync() is executable by personal_app/personal_ddl, not by the migration role
|
||||
-- (personal) in prod; deploy-remote.sh runs it as the app role after migrating.
|
||||
IF has_function_privilege('meta.sync(integer)', 'EXECUTE') THEN
|
||||
PERFORM meta.sync();
|
||||
END IF;
|
||||
END IF;
|
||||
END $$;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user