Fix stale tasks capability seed in deploy_tasks() -- add reallocate, fix wording

deploy_tasks() had its own embedded copy of the capability seed (separate from
auth/src/db.js and tasks/seed-app.js), still on the old 4-cap/"phase 2" set.
It only worked on this deploy because auth's own seed (DO UPDATE) raced ahead
of it; a fresh install would have silently skipped the reallocate cap.
This commit is contained in:
jtricerolph 2026-09-17 08:16:52 +00:00
parent 8ffca5740d
commit 653178fcf0

View file

@ -2402,12 +2402,14 @@ ${build_out}"
SELECT a.id, c.slug, c.name, c.description, c.sort_order
FROM apps a, (VALUES
('use', 'Use Tasks', 'Create and manage your own lists and tasks', 1),
('assign', 'Assign Tasks', 'Assign tasks to other users (phase 2)', 2),
('admin', 'Manage All', 'View and manage every user''s tasks (phase 2)', 3),
('settings', 'Settings', 'Configure tasks app settings', 4)
('assign', 'Assign Tasks', 'Hand off your own tasks to other users', 2),
('reallocate', 'Reallocate Tasks', 'View every user''s board and move any task between people', 3),
('admin', 'Manage All', 'View and manage every field of every user''s tasks (not yet built)', 4),
('settings', 'Settings', 'Configure the shared status pipeline and categories', 5)
) AS c(slug, name, description, sort_order)
WHERE a.slug = 'tasks'
ON CONFLICT (app_id, slug) DO NOTHING;
ON CONFLICT (app_id, slug) DO UPDATE SET
name = EXCLUDED.name, description = EXCLUDED.description, sort_order = EXCLUDED.sort_order;
INSERT INTO role_capabilities (role_id, capability_id)
SELECT r.id, ac.id FROM roles r
JOIN app_capabilities ac ON ac.app_id = (SELECT id FROM apps WHERE slug = 'tasks')