Skip to content

Commit cbc0486

Browse files
jk-ozlabsdaxtens
authored andcommitted
lib/sql: Update grant script for recent schema changes
This change fixes a few omissions in the grant scripts: - patchrelation is missing from both mysql and postgres scripts; it's only needed for web user access. - event is missing from the web grants on postgres, and the mail grants on mysql. Tested on postgres only. Fixes: 27c2acf ("models, templates: Add patch relations") Fixes: 34e3c9c ("sql: Update 'grant-all.mysql' script with missing tables") Fixes: 234bc7c ("lib/sql: fix permissions for v2.0.0 on postgres") Signed-off-by: Jeremy Kerr <jk@ozlabs.org> Signed-off-by: Daniel Axtens <dja@axtens.net>
1 parent e15fc9f commit cbc0486

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/sql/grant-all.mysql.sql

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_emailoptout TO 'www-data'@loca
2323
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_event TO 'www-data'@localhost;
2424
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patch TO 'www-data'@localhost;
2525
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchchangenotification TO 'www-data'@localhost;
26+
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchrelation TO 'www-data'@localhost;
2627
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_patchtag TO 'www-data'@localhost;
2728
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_person TO 'www-data'@localhost;
2829
GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_project TO 'www-data'@localhost;
@@ -38,6 +39,7 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON patchwork_userprofile_maintainer_project
3839
-- cover letters) and series
3940
GRANT INSERT, SELECT ON patchwork_comment TO 'nobody'@localhost;
4041
GRANT INSERT, SELECT ON patchwork_coverletter TO 'nobody'@localhost;
42+
GRANT INSERT, SELECT ON patchwork_event TO 'nobody'@localhost;
4143
GRANT INSERT, SELECT ON patchwork_patch TO 'nobody'@localhost;
4244
GRANT INSERT, SELECT ON patchwork_person TO 'nobody'@localhost;
4345
GRANT INSERT, SELECT ON patchwork_series TO 'nobody'@localhost;

lib/sql/grant-all.postgres.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ GRANT SELECT, UPDATE, INSERT, DELETE ON
2121
patchwork_delegationrule,
2222
patchwork_emailconfirmation,
2323
patchwork_emailoptout,
24+
patchwork_event,
2425
patchwork_patch,
2526
patchwork_patchchangenotification,
27+
patchwork_patchrelation,
2628
patchwork_patchtag,
2729
patchwork_person,
2830
patchwork_project,
@@ -50,7 +52,9 @@ GRANT SELECT, UPDATE ON
5052
patchwork_comment_id_seq,
5153
patchwork_delegationrule_id_seq,
5254
patchwork_emailconfirmation_id_seq,
55+
patchwork_event_id_seq,
5356
patchwork_patch_id_seq,
57+
patchwork_patchrelation_id_seq,
5458
patchwork_patchtag_id_seq,
5559
patchwork_person_id_seq,
5660
patchwork_project_id_seq,

0 commit comments

Comments
 (0)