xssbook2/db/rest/post/api_post.sql
2024-03-30 12:14:42 -04:00

15 lines
232 B
SQL

CREATE VIEW api.post AS
SELECT
p.id,
p.user_id,
p.content,
p.date
FROM
admin.post p
ORDER BY id DESC;
GRANT SELECT ON TABLE api.post
TO rest_anon, rest_user;
GRANT SELECT ON TABLE admin.post
TO rest_anon, rest_user;