Files
pipu-music/services/api/migrations/00012_upload_review.sql
T
mrleo1nidandClaude Opus 5.5 74da457362 feat(auth): make upload review a separate grant instead of an admin privilege
Reviewing the upload queue is now a per-user flag (reviews_uploads), not part
of the admin role: several people can hold it, a moderator can have it, and an
admin may not. Only admins grant or revoke it; existing admins keep it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-21 10:07:05 +03:00

9 lines
532 B
SQL

-- +goose Up
-- Аудит загрузок — отдельное право, не роль. Уже существующие админы его сохраняют,
-- чтобы очередь не осталась без того, кто её рассматривает. Новым админам его выдают явно.
ALTER TABLE users ADD COLUMN reviews_uploads boolean NOT NULL DEFAULT false;
UPDATE users SET reviews_uploads = true WHERE role = 'admin';
-- +goose Down
ALTER TABLE users DROP COLUMN reviews_uploads;