增加站内信未读提醒和后台通知中心+txt 校验
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
-- +goose Up
|
||||
-- +goose StatementBegin
|
||||
|
||||
INSERT INTO permissions (code, name, resource, action) VALUES
|
||||
('notification:view', '查看通知', 'notification', 'view')
|
||||
ON DUPLICATE KEY UPDATE
|
||||
name = VALUES(name),
|
||||
resource = VALUES(resource),
|
||||
action = VALUES(action);
|
||||
|
||||
INSERT IGNORE INTO role_permissions (role_id, permission_id)
|
||||
SELECT r.id, p.id
|
||||
FROM roles r
|
||||
JOIN permissions p ON p.code = 'notification:view'
|
||||
WHERE r.code IN ('super_admin', 'cs', 'ops');
|
||||
|
||||
-- +goose StatementEnd
|
||||
|
||||
-- +goose Down
|
||||
-- +goose StatementBegin
|
||||
|
||||
DELETE rp FROM role_permissions rp
|
||||
JOIN permissions p ON p.id = rp.permission_id
|
||||
WHERE p.code = 'notification:view';
|
||||
|
||||
DELETE FROM permissions WHERE code = 'notification:view';
|
||||
|
||||
-- +goose StatementEnd
|
||||
Reference in New Issue
Block a user