Revert "Disallow injecting platform DB as project DB"

This reverts commit 09c132414f.

# Conflicts:
#	src/Appwrite/Platform/Workers/Deletes.php
This commit is contained in:
Jake Barnby
2025-01-20 17:55:48 +13:00
parent 62c0226e1b
commit 099235c69f
4 changed files with 80 additions and 146 deletions
+5 -5
View File
@@ -97,12 +97,12 @@ CLI::setResource('dbForPlatform', function ($pools, $cache) {
return $dbForPlatform;
}, ['pools', 'cache']);
CLI::setResource('getProjectDB', function (Group $pools, Cache $cache) {
$databases = [];
CLI::setResource('getProjectDB', function (Group $pools, Database $dbForPlatform, $cache) {
$databases = []; // TODO: @Meldiron This should probably be responsibility of utopia-php/pools
return function (Document $project) use ($pools, $cache, &$databases) {
return function (Document $project) use ($pools, $dbForPlatform, $cache, &$databases) {
if ($project->isEmpty() || $project->getId() === 'console') {
throw new \Exception('Trying to inject project database using console project. Use "dbForPlatform" instead');
return $dbForPlatform;
}
try {
@@ -158,7 +158,7 @@ CLI::setResource('getProjectDB', function (Group $pools, Cache $cache) {
return $database;
};
}, ['pools', 'cache']);
}, ['pools', 'dbForPlatform', 'cache']);
CLI::setResource('queue', function (Group $pools) {
return $pools->get('queue')->pop()->getResource();