xssbook2/db/rest/comment/api_comment.sql

16 lines
256 B
SQL

CREATE VIEW api.comment AS
SELECT
c.id,
c.user_id,
c.post_id,
c.content,
c.date
FROM
admin.comment c
ORDER BY id ASC;
GRANT SELECT ON TABLE api.comment
TO rest_anon, rest_user;
GRANT SELECT ON TABLE admin.comment
TO rest_anon, rest_user;