From 0056ec4a0c8b527e3758fdfa3f9bf3b7263b6c79 Mon Sep 17 00:00:00 2001 From: Nils Hofstetter <119439839+Rignchen@users.noreply.github.com> Date: Fri, 5 Jul 2024 11:07:58 +0200 Subject: [PATCH] feat: allow users to remove users (#89) --- database/migration/deploy/2024-07-05.sql | 7 +++++++ database/migration/revert/2024-07-05.sql | 7 +++++++ database/migration/sqitch.plan | 1 + database/migration/verify/2024-07-05.sql | 7 +++++++ 4 files changed, 22 insertions(+) create mode 100644 database/migration/deploy/2024-07-05.sql create mode 100644 database/migration/revert/2024-07-05.sql create mode 100644 database/migration/verify/2024-07-05.sql diff --git a/database/migration/deploy/2024-07-05.sql b/database/migration/deploy/2024-07-05.sql new file mode 100644 index 0000000..4b62df9 --- /dev/null +++ b/database/migration/deploy/2024-07-05.sql @@ -0,0 +1,7 @@ +-- Deploy climat-guardian:2024-07-05 to pg + +BEGIN; + + grant delete on api.users to web_user; -- any user can remove users + +COMMIT; diff --git a/database/migration/revert/2024-07-05.sql b/database/migration/revert/2024-07-05.sql new file mode 100644 index 0000000..b5ebb4a --- /dev/null +++ b/database/migration/revert/2024-07-05.sql @@ -0,0 +1,7 @@ +-- Revert climat-guardian:2024-07-05 from pg + +BEGIN; + + revoke delete on api.users from web_user; -- any user can remove users + +COMMIT; diff --git a/database/migration/sqitch.plan b/database/migration/sqitch.plan index 41f8afc..762eec8 100644 --- a/database/migration/sqitch.plan +++ b/database/migration/sqitch.plan @@ -7,3 +7,4 @@ roles 2024-06-07T18:32:02Z Nils # create the role used by the user data 2024-06-07T20:09:18Z Nils # Add table to store data user 2024-06-07T20:47:39Z Nils # create a user table to store every user and password esp 2024-06-26T08:20:01Z dylan # create a esp table to stove every esp data +2024-07-05 2024-07-05T08:58:10Z Nils # Grant user the ability to remove users diff --git a/database/migration/verify/2024-07-05.sql b/database/migration/verify/2024-07-05.sql new file mode 100644 index 0000000..21370b2 --- /dev/null +++ b/database/migration/verify/2024-07-05.sql @@ -0,0 +1,7 @@ +-- Verify climat-guardian:2024-07-05 on pg + +BEGIN; + +-- XXX Add verifications here. + +ROLLBACK;