From f7cd1e236108e2b79c0ba1cb1831e26decdd5997 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Wed, 8 May 2024 16:04:28 +1200 Subject: [PATCH] Ensure namespace is set if override equals shared tables --- app/controllers/api/projects.php | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/controllers/api/projects.php b/app/controllers/api/projects.php index c1ffd6466f..c51697bf95 100644 --- a/app/controllers/api/projects.php +++ b/app/controllers/api/projects.php @@ -154,9 +154,14 @@ App::post('/v1/projects') // TODO: One in 20 projects use shared tables. Temporary until all projects are using shared tables. if ( - !\mt_rand(0, 19) - && System::getEnv('_APP_DATABASE_SHARED_TABLES', 'enabled') === 'enabled' - && System::getEnv('_APP_EDITION', 'self-hosted') !== 'self-hosted' + ( + !\mt_rand(0, 19) + && System::getEnv('_APP_DATABASE_SHARED_TABLES', 'enabled') === 'enabled' + && System::getEnv('_APP_EDITION', 'self-hosted') !== 'self-hosted' + ) || + ( + $dsn === DATABASE_SHARED_TABLES + ) ) { $schema = 'appwrite'; $database = 'appwrite';