forked from wrenn/wrenn
feat: add audit logging for all admin actions and admin audit page
Log every admin-panel action (user activate/deactivate, team BYOC toggle, team delete, template delete, build create/cancel) to the audit_logs table under PlatformTeamID with scope "admin". Add GET /v1/admin/audit-logs endpoint and /admin/audit frontend page with infinite scroll and hierarchical filters. Expose audit.Entry + Log() for cloud repo extensibility. Fix seed_platform_team down-migration FK violation by deleting dependent rows before the team row.
This commit is contained in:
@ -9,4 +9,10 @@ VALUES ('00000000-0000-0000-0000-000000000000', 'Platform', 'platform')
|
||||
ON CONFLICT (id) DO NOTHING;
|
||||
|
||||
-- +goose Down
|
||||
-- Delete dependent rows that reference the platform team via foreign keys.
|
||||
-- Order matters: children before parent.
|
||||
DELETE FROM sandboxes WHERE team_id = '00000000-0000-0000-0000-000000000000';
|
||||
DELETE FROM team_api_keys WHERE team_id = '00000000-0000-0000-0000-000000000000';
|
||||
DELETE FROM users_teams WHERE team_id = '00000000-0000-0000-0000-000000000000';
|
||||
DELETE FROM hosts WHERE team_id = '00000000-0000-0000-0000-000000000000';
|
||||
DELETE FROM teams WHERE id = '00000000-0000-0000-0000-000000000000';
|
||||
|
||||
Reference in New Issue
Block a user