feat(ECR-034): AdminGovernance PrivacyRequest 只读并 Closed
PrivacyRequest catalog (000035) · Loop continuous.
This commit is contained in:
@@ -0,0 +1,2 @@
|
||||
DELETE FROM admin_role_permissions WHERE code = 'admin.privacy.read';
|
||||
DROP TABLE IF EXISTS privacy_requests;
|
||||
@@ -0,0 +1,25 @@
|
||||
-- ECR-034 PrivacyRequest (read catalog)
|
||||
|
||||
CREATE TABLE IF NOT EXISTS privacy_requests (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
code varchar(64) NOT NULL UNIQUE,
|
||||
title varchar(128) NOT NULL,
|
||||
kind varchar(32) NOT NULL CHECK (kind IN ('export','erase')),
|
||||
status varchar(32) NOT NULL CHECK (status IN ('open','closed')),
|
||||
active boolean NOT NULL DEFAULT true,
|
||||
system boolean NOT NULL DEFAULT false,
|
||||
created_at timestamptz NOT NULL DEFAULT now(),
|
||||
updated_at timestamptz NOT NULL DEFAULT now()
|
||||
);
|
||||
|
||||
CREATE INDEX IF NOT EXISTS idx_privacy_requests_active ON privacy_requests(active);
|
||||
|
||||
INSERT INTO privacy_requests(code, title, kind, status, active, system)
|
||||
VALUES ('demo_export_req', '示例数据导出请求', 'export', 'closed', true, true)
|
||||
ON CONFLICT (code) DO NOTHING;
|
||||
|
||||
INSERT INTO admin_role_permissions(role_id, code)
|
||||
SELECT r.id, 'admin.privacy.read'
|
||||
FROM admin_roles r
|
||||
WHERE r.name = 'super_admin'
|
||||
ON CONFLICT DO NOTHING;
|
||||
Reference in New Issue
Block a user