Compare commits

...
Author SHA1 Message Date
Jake Barnby 3d48c42ebf Merge remote-tracking branch 'origin/1.6.x' into feat-single-shared-metadata-docs
# Conflicts:
#	Dockerfile
#	composer.json
#	composer.lock
2024-10-14 13:51:01 +13:00
Jake Barnby 11ec31aefb Update database 2024-08-13 21:49:25 +12:00
Jake Barnby 73ca1efbeb Catch duplicate db on project create 2024-08-13 21:49:14 +12:00
Jake Barnby 340aa48d93 Catch duplicate on console db create 2024-08-13 21:14:52 +12:00
Jake Barnby 8ff72b341e Don't set tenant for project collections creation 2024-08-12 23:46:34 +12:00
Jake Barnby a23402075e Update database 2024-08-12 17:45:43 +12:00
4 changed files with 28 additions and 14 deletions
+6 -2
View File
@@ -195,7 +195,7 @@ App::post('/v1/projects')
if ($dsn->getHost() === System::getEnv('_APP_DATABASE_SHARED_TABLES', '')) {
$dbForProject
->setSharedTables(true)
->setTenant($project->getInternalId())
->setTenant(null)
->setNamespace($dsn->getParam('namespace'));
} else {
$dbForProject
@@ -204,7 +204,11 @@ App::post('/v1/projects')
->setNamespace('_' . $project->getInternalId());
}
$dbForProject->create();
try {
$dbForProject->create();
} catch (Duplicate) {
// Database already exists
}
$audit = new Audit($dbForProject);
$audit->setup();
+3 -2
View File
@@ -16,6 +16,7 @@ use Utopia\CLI\Console;
use Utopia\Config\Config;
use Utopia\Database\Database;
use Utopia\Database\Document;
use Utopia\Database\Exception\Duplicate;
use Utopia\Database\Helpers\ID;
use Utopia\Database\Helpers\Permission;
use Utopia\Database\Helpers\Role;
@@ -92,7 +93,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg
try {
Console::success('[Setup] - Creating database: appwrite...');
$dbForConsole->create();
} catch (\Throwable $e) {
} catch (Duplicate) {
Console::success('[Setup] - Skip: metadata table already exists');
}
@@ -224,7 +225,7 @@ $http->on(Constant::EVENT_START, function (Server $http) use ($payloadSize, $reg
});
});
$http->on('request', function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) use ($register) {
$http->on(Constant::EVENT_REQUEST, function (SwooleRequest $swooleRequest, SwooleResponse $swooleResponse) use ($register) {
App::setResource('swooleRequest', fn () => $swooleRequest);
App::setResource('swooleResponse', fn () => $swooleResponse);
+1 -1
View File
@@ -51,7 +51,7 @@
"utopia-php/cache": "0.10.*",
"utopia-php/cli": "0.15.*",
"utopia-php/config": "0.2.*",
"utopia-php/database": "0.53.6",
"utopia-php/database": "dev-feat-migrations as 0.53.6",
"utopia-php/domains": "0.5.*",
"utopia-php/dsn": "0.2.1",
"utopia-php/framework": "0.33.*",
Generated
+18 -9
View File
@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically"
],
"content-hash": "5fef87b7ea4352869a502d1570bd43e7",
"content-hash": "d42da1155330aeb8432fdedffaec3332",
"packages": [
{
"name": "adhocore/jwt",
@@ -1724,16 +1724,16 @@
},
{
"name": "utopia-php/database",
"version": "0.53.6",
"version": "dev-feat-migrations",
"source": {
"type": "git",
"url": "https://github.com/utopia-php/database.git",
"reference": "feddc8e808eaea9a11c65cca3f01683def422f52"
"reference": "fde34787ab35383a33ded502a3b5327766cc0be2"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/utopia-php/database/zipball/feddc8e808eaea9a11c65cca3f01683def422f52",
"reference": "feddc8e808eaea9a11c65cca3f01683def422f52",
"url": "https://api.github.com/repos/utopia-php/database/zipball/fde34787ab35383a33ded502a3b5327766cc0be2",
"reference": "fde34787ab35383a33ded502a3b5327766cc0be2",
"shasum": ""
},
"require": {
@@ -1774,9 +1774,9 @@
],
"support": {
"issues": "https://github.com/utopia-php/database/issues",
"source": "https://github.com/utopia-php/database/tree/0.53.6"
"source": "https://github.com/utopia-php/database/tree/feat-migrations"
},
"time": "2024-10-08T02:18:46+00:00"
"time": "2024-10-14T00:46:48+00:00"
},
{
"name": "utopia-php/domains",
@@ -7002,9 +7002,18 @@
"time": "2024-03-07T20:33:40+00:00"
}
],
"aliases": [],
"aliases": [
{
"package": "utopia-php/database",
"version": "dev-feat-migrations",
"alias": "0.53.6",
"alias_normalized": "0.53.6.0"
}
],
"minimum-stability": "stable",
"stability-flags": [],
"stability-flags": {
"utopia-php/database": 20
},
"prefer-stable": false,
"prefer-lowest": false,
"platform": {