From 0f250ba06c022c0ba89cfdba9c1a74065771b3ac Mon Sep 17 00:00:00 2001 From: Christopher Kolstad Date: Mon, 11 Dec 2023 15:39:44 +0100 Subject: [PATCH] feat: add created_by to role_permission table (#5592) As it says on the tin. In an attempt to make all operations in Unleash traceable to an originator. This PR adds created_by to role_permission, which will show which user assigned a permission to a role. --- .../20231211132341-add-created-by-to-role-permission.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/migrations/20231211132341-add-created-by-to-role-permission.js diff --git a/src/migrations/20231211132341-add-created-by-to-role-permission.js b/src/migrations/20231211132341-add-created-by-to-role-permission.js new file mode 100644 index 0000000000..9c71a8f1cb --- /dev/null +++ b/src/migrations/20231211132341-add-created-by-to-role-permission.js @@ -0,0 +1,7 @@ +exports.up = function(db, cb) { + db.runSql(`ALTER TABLE role_permission ADD COLUMN created_by INTEGER`, cb); +}; + +exports.down = function(db, cb) { + db.runSql(`ALTER TABLE role_permission DROP COLUMN created_by`, cb); +}; \ No newline at end of file