Skip to content

Commit

Permalink
feat: added DB roles for microservices
Browse files Browse the repository at this point in the history
  • Loading branch information
SlashLight committed Nov 29, 2024
1 parent 03e244c commit b240895
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion DB/migrations/000002_init_roles.up.sql
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,11 @@ GRANT SELECT, INSERT, DELETE, UPDATE ON profile, friend TO profile_service;

CREATE ROLE community_service WITH LOGIN PASSWORD 'community_password';
GRANT CONNECT ON DATABASE mydbvk TO community_service;
GRANT SELECT, INSERT, DELETE, UPDATE ON community, community_profile TO community_service;
GRANT USAGE ON SCHEMA public TO community_service;
GRANT SELECT, INSERT, DELETE, UPDATE, REFERENCES, TRUNCATE, TRIGGER, MAINTAIN ON community, community_profile TO community_service;
GRANT ALL PRIVILEGES ON ALL SEQUENCES IN SCHEMA public TO community_service;
GRANT ALL PRIVILEGES ON community, community_profile, admin TO community_service;
GRANT ALL PRIVILEGES ON ALL TABLES IN SCHEMA public TO community_service;

CREATE ROLE post_service WITH LOGIN PASSWORD 'post_password';
GRANT CONNECT ON DATABASE mydbvk TO post_service;
Expand Down

0 comments on commit b240895

Please sign in to comment.