1
0
Fork 0
mirror of synced 2024-06-27 02:31:04 +12:00

update projects database

This commit is contained in:
shimon 2023-10-08 16:44:14 +03:00
parent 030f9629a6
commit 31466c44d8
2 changed files with 16 additions and 6 deletions

View file

@ -100,6 +100,7 @@ App::post('/v1/projects')
$databases = Config::getParam('pools-database', []);
/**
* Extract db from list while backing
*/
@ -167,6 +168,15 @@ App::post('/v1/projects')
throw new Exception(Exception::PROJECT_ALREADY_EXISTS);
}
/**
* Update database with self-managed db every $mod projects
*/
$mod = 2;
if ($index = array_search('db_fra1_sm1_0', $databases) && $project->getInternalId() % $mod === 0) {
$project->setAttribute('database', $databases[$index]);
$dbForConsole->updateDocument('projects', $project);
}
$dbForProject = new Database($pools->get($database)->pop()->getResource(), $cache);
$dbForProject->setNamespace("_{$project->getInternalId()}");
$dbForProject->create();

12
composer.lock generated
View file

@ -1050,16 +1050,16 @@
},
{
"name": "matomo/device-detector",
"version": "6.1.5",
"version": "6.1.6",
"source": {
"type": "git",
"url": "https://github.com/matomo-org/device-detector.git",
"reference": "40ca2990dba2c1719e5c62168e822e0b86c167d4"
"reference": "5cbea85106e561c7138d03603eb6e05128480409"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/40ca2990dba2c1719e5c62168e822e0b86c167d4",
"reference": "40ca2990dba2c1719e5c62168e822e0b86c167d4",
"url": "https://api.github.com/repos/matomo-org/device-detector/zipball/5cbea85106e561c7138d03603eb6e05128480409",
"reference": "5cbea85106e561c7138d03603eb6e05128480409",
"shasum": ""
},
"require": {
@ -1115,7 +1115,7 @@
"source": "https://github.com/matomo-org/matomo",
"wiki": "https://dev.matomo.org/"
},
"time": "2023-08-17T16:17:41+00:00"
"time": "2023-10-02T10:01:54+00:00"
},
{
"name": "mongodb/mongodb",
@ -6017,5 +6017,5 @@
"platform-overrides": {
"php": "8.0"
},
"plugin-api-version": "2.6.0"
"plugin-api-version": "2.2.0"
}