Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
18 commits
Select commit Hold shift + click to select a range
a259e29
feat: adapt migration schema calls to query-lib value objects
abnegate Aug 14, 2026
d32d196
fix: accept query-lib biginteger as API bigint
abnegate Aug 14, 2026
47e2597
fix: create collection metadata from the persisted database sequence
abnegate Aug 14, 2026
cce7c66
(fix): allow migrating HuggingFace OAuth2 providers
abnegate Aug 21, 2026
340e6c6
chore: merge origin/main into feat-query-lib
abnegate Aug 21, 2026
0144e33
chore: pin utopia-php/database to Appwrite's feat-query-lib SHA
abnegate Aug 21, 2026
a11db20
test: stub Swoole Coroutine when the extension is missing
abnegate Aug 21, 2026
55b92c7
fix: mark databases failed when metadata reload misses
abnegate Aug 21, 2026
b67ace1
(chore): use caret ranges for Utopia dependencies
abnegate Aug 21, 2026
7a3a60e
(chore): refresh lockfile after caret Utopia constraints
abnegate Aug 21, 2026
f2de906
(feat): pass Collection to createCollection
abnegate Aug 21, 2026
3fccb0c
(fix): pass Attribute models to checkAttribute
abnegate Aug 21, 2026
3a5fb77
(fix): pass Attribute models into checkAttribute
abnegate Aug 21, 2026
18c09d4
(fix): recover failed databases on OnDuplicate::Fail retries
abnegate Aug 21, 2026
04ab893
(refactor): use Schema\Order and wrap Collection constructors
abnegate Aug 21, 2026
bf52c2c
chore(deps): drop the deleted query branch from the lock and re-pin d…
abnegate Aug 27, 2026
24e0f03
fix(destination): map index orders onto Order before building the index
abnegate Aug 27, 2026
ff6f1d5
fix(destination): let a database stranded in provisioning be retried
abnegate Aug 27, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 20 additions & 17 deletions bin/MigrationCLI.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
use Utopia\Migration\Sources\NHost;
use Utopia\Migration\Sources\Supabase;
use Utopia\Migration\Transfer;
use Utopia\Query\Schema\ColumnType;
use Utopia\Query\Schema\IndexType;
use Utopia\Query\Schema\Order;

/**
* Migrations CLI Tool
Expand All @@ -38,7 +41,7 @@ class MigrationCLI
'attributes' => [
[
'$id' => 'databaseInternalId',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'format' => '',
'size' => Database::LENGTH_KEY,
'signed' => true,
Expand All @@ -49,7 +52,7 @@ class MigrationCLI
],
[
'$id' => 'databaseId',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'signed' => true,
'size' => Database::LENGTH_KEY,
'format' => '',
Expand All @@ -60,7 +63,7 @@ class MigrationCLI
],
[
'$id' => 'name',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'size' => Database::LENGTH_KEY,
'required' => true,
'signed' => true,
Expand All @@ -69,7 +72,7 @@ class MigrationCLI
],
[
'$id' => 'enabled',
'type' => Database::VAR_BOOLEAN,
'type' => ColumnType::Boolean->value,
'signed' => true,
'size' => 0,
'format' => '',
Expand All @@ -80,7 +83,7 @@ class MigrationCLI
],
[
'$id' => 'documentSecurity',
'type' => Database::VAR_BOOLEAN,
'type' => ColumnType::Boolean->value,
'signed' => true,
'size' => 0,
'format' => '',
Expand All @@ -91,7 +94,7 @@ class MigrationCLI
],
[
'$id' => 'attributes',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'size' => 1000000,
'required' => false,
'signed' => true,
Expand All @@ -100,7 +103,7 @@ class MigrationCLI
],
[
'$id' => 'indexes',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'size' => 1000000,
'required' => false,
'signed' => true,
Expand All @@ -109,7 +112,7 @@ class MigrationCLI
],
[
'$id' => 'search',
'type' => Database::VAR_STRING,
'type' => ColumnType::String->value,
'format' => '',
'size' => 16384,
'signed' => true,
Expand All @@ -122,31 +125,31 @@ class MigrationCLI
'indexes' => [
[
'$id' => '_fulltext_search',
'type' => Database::INDEX_FULLTEXT,
'type' => IndexType::Fulltext->value,
'attributes' => ['search'],
'lengths' => [],
'orders' => [],
],
[
'$id' => '_key_name',
'type' => Database::INDEX_KEY,
'type' => IndexType::Key->value,
'attributes' => ['name'],
'lengths' => [Database::LENGTH_KEY],
'orders' => [Database::ORDER_ASC],
'orders' => [Order::Asc->value],
],
[
'$id' => '_key_enabled',
'type' => Database::INDEX_KEY,
'type' => IndexType::Key->value,
'attributes' => ['enabled'],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
'orders' => [Order::Asc->value],
],
[
'$id' => '_key_documentSecurity',
'type' => Database::INDEX_KEY,
'type' => IndexType::Key->value,
'attributes' => ['documentSecurity'],
'lengths' => [],
'orders' => [Database::ORDER_ASC],
'orders' => [Order::Asc->value],
],
],
];
Expand Down Expand Up @@ -280,15 +283,15 @@ function (mixed $value, Document $document, Database $database) {
$attributeType = $attribute->getAttribute('type');

switch ($attributeType) {
case Database::VAR_RELATIONSHIP:
case ColumnType::Relationship->value:
$options = $attribute->getAttribute('options');
foreach ($options as $key => $value) {
$attribute->setAttribute($key, $value);
}
$attribute->removeAttribute('options');
break;

case Database::VAR_STRING:
case ColumnType::String->value:
$filters = $attribute->getAttribute('filters', []);
$attribute->setAttribute('encrypt', in_array('encrypt', $filters));
break;
Expand Down
23 changes: 19 additions & 4 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@
"migration"
],
"license": "MIT",
"minimum-stability": "stable",
"minimum-stability": "dev",
"prefer-stable": true,
"autoload": {
"psr-4": {
"Utopia\\Migration\\": "src/Migration"
Expand All @@ -32,9 +33,9 @@
"ext-curl": "*",
"ext-openssl": "*",
"appwrite/appwrite": "^27.0",
"utopia-php/database": "^7.0.0",
"utopia-php/storage": "4.*",
"utopia-php/dsn": "0.2.*",
"utopia-php/database": "dev-feat-query-lib as 7.0.0",
"utopia-php/storage": "^4.0",
"utopia-php/dsn": "^0.2",
"halaxa/json-machine": "^1.2"
},
"require-dev": {
Expand All @@ -44,6 +45,20 @@
"laravel/pint": "1.*",
"phpstan/phpstan": "1.*"
},
"repositories": [
{
"type": "vcs",
"url": "https://github.com/utopia-php/database.git"
},
{
"type": "vcs",
"url": "https://github.com/utopia-php/query.git"
},
{
"type": "vcs",
"url": "https://github.com/utopia-php/async.git"
}
],
"config": {
"allow-plugins": {
"php-http/discovery": true,
Expand Down
Loading
Loading