From 298e985d748321f1909f780bcafe3174c0791b20 Mon Sep 17 00:00:00 2001 From: Leystryku Date: Sat, 17 Jul 2021 19:01:37 +0200 Subject: [PATCH] Permission for referencing other tables (foreign keys) (#3419) --- app/Repositories/Eloquent/DatabaseRepository.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Eloquent/DatabaseRepository.php b/app/Repositories/Eloquent/DatabaseRepository.php index ab0bf709d..c42cb91b2 100644 --- a/app/Repositories/Eloquent/DatabaseRepository.php +++ b/app/Repositories/Eloquent/DatabaseRepository.php @@ -107,7 +107,7 @@ class DatabaseRepository extends EloquentRepository implements DatabaseRepositor public function assignUserToDatabase(string $database, string $username, string $remote): bool { return $this->run(sprintf( - 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, INDEX, LOCK TABLES, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `%s`.* TO `%s`@`%s`', + 'GRANT SELECT, INSERT, UPDATE, DELETE, CREATE, DROP, ALTER, REFERENCES, INDEX, LOCK TABLES, CREATE ROUTINE, ALTER ROUTINE, EXECUTE ON `%s`.* TO `%s`@`%s`', $database, $username, $remote