diff --git a/app/config/collections.php b/app/config/collections.php index d8f65da788..334c1ae406 100644 --- a/app/config/collections.php +++ b/app/config/collections.php @@ -2076,7 +2076,7 @@ $collections = [ '$id' => ID::custom('name'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, @@ -2097,7 +2097,7 @@ $collections = [ '$id' => ID::custom('runtime'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, @@ -2209,65 +2209,65 @@ $collections = [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_enabled'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled'], 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_runtime'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['runtime'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_deployment'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['deployment'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_schedule'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['schedule'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_scheduleNext'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['scheduleNext'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_schedulePrevious'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['schedulePrevious'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_timeout'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['timeout'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], + 'orders' => [], ], + // [ + // '$id' => ID::custom('_key_name'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['name'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_enabled'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['enabled'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_runtime'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['runtime'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_deployment'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['deployment'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_schedule'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['schedule'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_scheduleNext'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['scheduleNext'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_schedulePrevious'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['schedulePrevious'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_timeout'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['timeout'], + // 'lengths' => [], + // 'orders' => [], + // ], ], ], @@ -2314,7 +2314,7 @@ $collections = [ '$id' => ID::custom('entrypoint'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, @@ -2324,7 +2324,7 @@ $collections = [ '$id' => ID::custom('path'), 'type' => Database::VAR_STRING, 'format' => '', - 'size' => 2048, + 'size' => 16384, 'signed' => true, 'required' => false, 'default' => null, @@ -2399,55 +2399,55 @@ $collections = [ ] ], 'indexes' => [ - [ - '$id' => ID::custom('_key_resource'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_resource_type'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['resourceType'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [], - 'orders' => [], - ], - [ - '$id' => ID::custom('_key_entrypoint'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['entrypoint'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_size'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['size'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_buildId'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['buildId'], - 'lengths' => [Database::LENGTH_KEY], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_activate'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['activate'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], + // [ + // '$id' => ID::custom('_key_resource'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['resourceId'], + // 'lengths' => [Database::LENGTH_KEY], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_resource_type'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['resourceType'], + // 'lengths' => [Database::LENGTH_KEY], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_search'), + // 'type' => Database::INDEX_FULLTEXT, + // 'attributes' => ['search'], + // 'lengths' => [], + // 'orders' => [], + // ], + // [ + // '$id' => ID::custom('_key_entrypoint'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['entrypoint'], + // 'lengths' => [Database::LENGTH_KEY], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_size'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['size'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_buildId'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['buildId'], + // 'lengths' => [Database::LENGTH_KEY], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_activate'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['activate'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], ], ], @@ -2935,62 +2935,62 @@ $collections = [ ], ], 'indexes' => [ - [ - '$id' => ID::custom('_fulltext_name'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['name'], - 'lengths' => [1024], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_search'), - 'type' => Database::INDEX_FULLTEXT, - 'attributes' => ['search'], - 'lengths' => [2048], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_enabled'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['enabled'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_name'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['name'], - 'lengths' => [128], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_fileSecurity'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['fileSecurity'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_maximumFileSize'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['maximumFileSize'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_encryption'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['encryption'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], - [ - '$id' => ID::custom('_key_antivirus'), - 'type' => Database::INDEX_KEY, - 'attributes' => ['antivirus'], - 'lengths' => [], - 'orders' => [Database::ORDER_ASC], - ], + // [ + // '$id' => ID::custom('_fulltext_name'), + // 'type' => Database::INDEX_FULLTEXT, + // 'attributes' => ['name'], + // 'lengths' => [1024], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_search'), + // 'type' => Database::INDEX_FULLTEXT, + // 'attributes' => ['search'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_enabled'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['enabled'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_name'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['name'], + // 'lengths' => [128], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_fileSecurity'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['fileSecurity'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_maximumFileSize'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['maximumFileSize'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_encryption'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['encryption'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], + // [ + // '$id' => ID::custom('_key_antivirus'), + // 'type' => Database::INDEX_KEY, + // 'attributes' => ['antivirus'], + // 'lengths' => [], + // 'orders' => [Database::ORDER_ASC], + // ], ] ], @@ -3383,7 +3383,7 @@ $collections = [ '$id' => ID::custom('_key_search'), 'type' => Database::INDEX_FULLTEXT, 'attributes' => ['search'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ @@ -3397,14 +3397,14 @@ $collections = [ '$id' => ID::custom('_key_name'), 'type' => Database::INDEX_KEY, 'attributes' => ['name'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ '$id' => ID::custom('_key_signature'), 'type' => Database::INDEX_KEY, 'attributes' => ['signature'], - 'lengths' => [2048], + 'lengths' => [], 'orders' => [Database::ORDER_ASC], ], [ diff --git a/app/controllers/api/databases.php b/app/controllers/api/databases.php index e2acb30772..22f1644de3 100644 --- a/app/controllers/api/databases.php +++ b/app/controllers/api/databases.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\Document; use Utopia\Database\DateTime; use Utopia\Database\Query; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Validator\Authorization; use Utopia\Database\Validator\Key; use Utopia\Database\Validator\Permissions; diff --git a/app/init.php b/app/init.php index 3c9f785f9d..f55984512d 100644 --- a/app/init.php +++ b/app/init.php @@ -52,7 +52,7 @@ use MaxMind\Db\Reader; use PHPMailer\PHPMailer\PHPMailer; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Document; use Utopia\Database\Database; use Utopia\Database\Validator\Structure; @@ -928,7 +928,7 @@ App::setResource('console', function () { App::setResource('dbForProject', function ($db, $cache, Document $project) { $cache = new Cache(new RedisCache($cache)); - $database = new Database(new MariaDB($db), $cache); + $database = new Database(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace("_{$project->getInternalId()}"); @@ -938,7 +938,7 @@ App::setResource('dbForProject', function ($db, $cache, Document $project) { App::setResource('dbForConsole', function ($db, $cache) { $cache = new Cache(new RedisCache($cache)); - $database = new Database(new MariaDB($db), $cache); + $database = new Database(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace('_console'); diff --git a/app/realtime.php b/app/realtime.php index be87c3d6e6..8004677414 100644 --- a/app/realtime.php +++ b/app/realtime.php @@ -20,7 +20,7 @@ use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Document; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; @@ -107,7 +107,7 @@ function getDatabase(Registry &$register, string $namespace) $redis = $register->get('redisPool')->get(); $cache = new Cache(new RedisCache($redis)); - $database = new Database(new MariaDB($db), $cache); + $database = new Database(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace($namespace); @@ -382,7 +382,7 @@ $server->onOpen(function (int $connection, SwooleRequest $request) use ($server, $console = $app->getResource('console'); $cache = new Cache(new RedisCache($redis)); - $database = new Database(new MariaDB($db), $cache); + $database = new Database(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace("_{$project->getInternalId()}"); @@ -489,7 +489,7 @@ $server->onMessage(function (int $connection, string $message) use ($server, $re $redis = $register->get('redisPool')->get(); $cache = new Cache(new RedisCache($redis)); - $database = new Database(new MariaDB($db), $cache); + $database = new Database(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace("_console"); $projectId = $realtime->connections[$connection]['projectId']; diff --git a/app/tasks/maintenance.php b/app/tasks/maintenance.php index 42b5ed00dc..b8ad5adcbd 100644 --- a/app/tasks/maintenance.php +++ b/app/tasks/maintenance.php @@ -9,7 +9,7 @@ use Appwrite\Event\Delete; use Utopia\App; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Database; use Utopia\Database\DateTime; use Utopia\Cache\Adapter\Redis as RedisCache; @@ -26,7 +26,7 @@ function getConsoleDB(): Database try { $attempts++; $cache = new Cache(new RedisCache($register->get('cache'))); - $database = new Database(new MariaDB($register->get('db')), $cache); + $database = new Database(new MySQL($register->get('db')), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace('_console'); // Main DB diff --git a/app/tasks/migrate.php b/app/tasks/migrate.php index f0ab71a964..c30cd33459 100644 --- a/app/tasks/migrate.php +++ b/app/tasks/migrate.php @@ -7,7 +7,7 @@ use Appwrite\Migration\Migration; use Utopia\App; use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Database; use Utopia\Database\Query; use Utopia\Database\Validator\Authorization; @@ -33,10 +33,10 @@ $cli $redis->flushAll(); $cache = new Cache(new RedisCache($redis)); - $projectDB = new Database(new MariaDB($db), $cache); + $projectDB = new Database(new MySQL($db), $cache); $projectDB->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); - $consoleDB = new Database(new MariaDB($db), $cache); + $consoleDB = new Database(new MySQL($db), $cache); $consoleDB->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $consoleDB->setNamespace('_project_console'); diff --git a/app/tasks/usage.php b/app/tasks/usage.php index 48876557a8..34519bcce4 100644 --- a/app/tasks/usage.php +++ b/app/tasks/usage.php @@ -12,7 +12,7 @@ use Utopia\App; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\Cache\Cache; use Utopia\CLI\Console; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Database\Database as UtopiaDatabase; use Utopia\Database\Validator\Authorization; use Utopia\Registry\Registry; @@ -34,7 +34,7 @@ function getDatabase(Registry &$register, string $namespace): UtopiaDatabase $redis = $register->get('cache'); $cache = new Cache(new RedisCache($redis)); - $database = new UtopiaDatabase(new MariaDB($db), $cache); + $database = new UtopiaDatabase(new MySQL($db), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace($namespace); diff --git a/src/Appwrite/Resque/Worker.php b/src/Appwrite/Resque/Worker.php index 40adc3e52e..d7f0872912 100644 --- a/src/Appwrite/Resque/Worker.php +++ b/src/Appwrite/Resque/Worker.php @@ -7,7 +7,7 @@ use Utopia\Cache\Cache; use Utopia\Cache\Adapter\Redis as RedisCache; use Utopia\CLI\Console; use Utopia\Database\Database; -use Utopia\Database\Adapter\MariaDB; +use Utopia\Database\Adapter\MySQL; use Utopia\Storage\Device; use Utopia\Storage\Storage; use Utopia\Storage\Device\Local; @@ -221,7 +221,7 @@ abstract class Worker try { $attempts++; $cache = new Cache(new RedisCache($register->get('cache'))); - $database = new Database(new MariaDB($register->get('db')), $cache); + $database = new Database(new MySQL($register->get('db')), $cache); $database->setDefaultDatabase(App::getEnv('_APP_DB_SCHEMA', 'appwrite')); $database->setNamespace($namespace); // Main DB