Conversation
Published 2.0 still used Database::VAR_* and positional createAttribute/createIndex, which feat-query-lib removed. Rebase onto main and pass Attribute/Index/Relationship VOs plus ColumnType/IndexType so Appwrite can pin this branch as 2.0.0.
Appwrite stores ColumnType::BigInteger as biginteger. CSV export resolved that as an unsupported column type and wrote no rows.
createDocument can return an empty Mongo sequence while a subsequent
getDocument has the ObjectId. Creating database_{seq} from the create
return left table import looking up a collection that did not exist.
Appwrite main added huggingface as a project OAuth2 provider. Without an allow-list entry, Appwrite-to-Appwrite migrations fail on that provider even when the rest of the transfer succeeded.
Keep query-lib APIs and the huggingface PROVIDERS allow-list already on main.
Appwrite #11649 locks database at 5719edd. Staying on e593b78 would only prove the schema VO calls against an older query-lib surface.
|
utopia-php/database feat-query-lib keys silenced events with Coroutine::getCid(). The CI image is vanilla PHP, so Memory-adapter tests fatalled before they could run.
createDocument can persist a row whose subsequent getDocument is empty. That throw sat outside the failed-status handler, so a later skip could flip the unusable database to ready without a backing collection.
|
Addressed the reload-failure finding.
Reload + Also stubbed @greptile-apps review |
Asterisk wildcards on utopia-php packages are replaced with equivalent caret constraints so Composer ranges stay consistent.
Keep composer.json and composer.lock in sync so `composer validate` passes, and pin utopia-php/database to the current query-lib HEAD.
|
@greptileai review |
|
@greptile-apps review Force re-review of HEAD |
Database::createCollection no longer accepts a string id.
Database::checkAttribute now requires Attribute. Build schema models from the resource key so metadata document IDs are not used as attribute keys.
Appwrite E2E migrations failed because checkAttribute now requires Attribute, and the destination still handed it a metadata Document.
A reload failure leaves a metadata document in `failed` with no backing collection. Recovery only ran when onDuplicate was not Fail, so the default policy retried createDocument against the existing ID and stranded the database.
|
@greptileai review |
Index types already used IndexType; column direction was still a raw ASC string. Collection constructors with multiple named params were also jammed on one line.
…atabase The lock held utopia-php/query at dev-feat-schema-order, a branch that no longer exists on the remote, so the resolution only survived as long as nobody resolved it again. database's branch requires query 0.6.*, which is released, so this takes the release. storage 4.0.4 comes along because 4.0.3 capped utopia-php/validators at ^0.4 while database requires ^0.5; 4.0.4 dropped the validators dependency outright. database has required ^0.5 on main as well as on the branch, so this was already true before the query-lib work and only surfaced now that the lock moved. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Both store a plain client id and secret, so only the client id is readable and migratable. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> (cherry picked from commit ea342db)
The lock still pinned 6cc5f8be, two reconciles behind: the branch's green CI was proving a database revision that will not ship. a137475 carries the merge with main and the batched upsert read. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptileai review |
The guard read Appwrite.php and pinned source fragments, so a reformat broke it while a real regression could still pass. Transfer a column through the public entry point instead and record what the project database is handed: the metadata row beside it is keyed by the composite attribute id, so a column named after that id is measured against a table that never holds it. Verified red on both regression shapes. Passing the metadata document fails the type the collaborator requires; rebuilding the attribute from that document's array copy reaches checkAttribute with key 1_1_title where the transfer's column is title. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptileai review |
The guard reached resolveDestinationDsn by reflection, so it never ran the line deciding whether the creation path consults the resolver at all. Writing the source DSN straight into the row, which is the comuneo incident, left all three cases green. Transfer a database through the public entry point instead and read back _databases.database. Verified red on that shape: every case reports the source host database_db_fra1_self_hosted_11_0 where the destination must carry a blank or the resolver's own value. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptileai review |
Five of the ten assertions pinned English sentences from the help text, which a reword breaks without changing behaviour. The other five are interface tokens a user types, and one of them carries a property nothing else covers: the neighbouring test proves --recover-provisioning is refused, not that it stays unadvertised. Re-adding it to getHelp() fails this test and no other. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
|
@greptileai review |
database's feat-query-lib merged main (1ea2f35), which raised utopia-php/validators to ^1.0. The lock was still on a137475 with validators 0.6.0. storage 4.0.5 pins validators ^0.6, so it moves to 4.1.0 (the first release accepting ^1.0), bringing the minors it requires. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Picks up the read-replica write-hook sync and the schema-bound aggregate validators, so CI here proves this branch against the base the rest of the train now uses. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Picks up the main merge on the database branch. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Picks up the required-change fix for attribute updates. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The database adapter now calls alterColumnNullable(), which 0.6.0 does not have, so an attribute update that changes required fataled. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The database library no longer carries a per-document version, so the compare-and-set on `expectedVersion` has nothing to compare. The ownership writes now run under withRequestTimestamp with the timestamp the row was read with: every update moves `$updatedAt` strictly forward, so a row another writer touched between the locked read and the write is refused as a conflict exactly as before, and the rows are still locked with forUpdate inside the claim transaction. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
…head Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Adapts the migration destination's schema calls to the query-lib value objects.
Why this approach
Database::createCollection()takes aCollectiononly, so destination Appwrite now wraps the collection id, attributes and indexes — along with the named permissions anddocumentSecurity— innew Collection(...)instead of passing positional arrays.utopia-php/databaseis pinned todev-feat-query-lib as 2.0.0, re-pinned to that branch's head whenever it moves.Lock repairs that came with the re-pin
Two problems surfaced only when the lock was resolved again rather than reused:
utopia-php/querywas locked todev-feat-schema-order, a branch that no longer exists on the remote. The resolution survived only as long as nobody resolved it. database's branch requiresquery 0.6.*, which is released, so the lock now takes the release.utopia-php/storagemoved 4.0.3 → 4.0.4, because 4.0.3 cappedutopia-php/validatorsat^0.4while database requires^0.5. 4.0.4 dropped the validators dependency outright. database has required^0.5onmainas well as on the branch, so this was already true before the query-lib work and only surfaced now.A live bug the re-pin exposed
The Appwrite destination passed the
'ASC'/'DESC'strings a source hands back straight intoUtopia\Database\Index, which takesOrdercases and rejects anything else. The resultingInvalidArgumentExceptionis not a MigrationException, so instead of recording a failed index the whole transfer aborted.This was already true before this PR and simply could not be seen: the lock held
queryat the deleted branch, whoseIndextook plain strings, so CI had never built an index against the contract the released library actually has.AppwriteIndexLengthsTestcovers it — two of its cases pass['ASC', 'ASC'], and both went red on the first run against the re-pinned lock and green with the fix.It is the same defect as the one in appwrite/appwrite#11649's
Databasesworker, from the same cause.Also on this branch: provisioning ownership and recovery
The branch has grown well past its title. Alongside the value-object adaptation it carries a provisioning-owner / lifecycle-fencing subsystem added 2026-08-29..31, which does not depend on query-lib at all:
Destinations/Appwrite/ProvisioningOwner.phpand owner persistence inDestinations/Appwrite.phpbin/MigrationCLI.phpAppwriteDatabaseConcurrencyTest(+400),AppwriteDatabaseStatusTest(+1026),MigrationCLITest(+342),ProvisioningOwnerTest(+36)Total diff against
mainis +3450/-714 over 23 files. Recommendation: split those commits into a PR againstmainso they can ship now, and leave only theCollection/Attribute/Index/Orderadaptation and the lock re-pin here, where it is blocked on database#823 being tagged.Chain
Landing order, bottom up:
The three framework PRs once stacked on #823 — #947 (ORM), #948 (repositories and seeding), #949 (migration runner and schema differ) — are closed and are not part of this train.
Verified
Not verified
Destinations/Appwrite.phpregions; whichever lands second will need a merge.utopia-php/databasedependency is still a branch pin. It becomes a released tag only once #823 merges, and this PR should not land before that.