Repository navigation
feat: add the description attribute to the collection schema - #14471
Conversation
Adds an optional `description` string (size 1024, default '') to functions, sites, variables, databases, attributes, indexes, keys, webhooks, buckets, topics and the per-database metadata collection template, with the V25 upgrade steps that add it to existing installs. Schema only: no endpoint reads or writes the attribute yet, and response models do not expose it. The API side follows in #14355. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Review complete. No blocking issues — approved ✅; 1 nitpick below. 🧹 Nitpicks (1) — 🟢 1 low
The change stages a
Reviewed commit: 33ee90d |
🔵 Tier A · Mergeable after minor fixes
Adds an optional
Fix with agent prompt### Issue 1
src/Appwrite/Migration/Version/V25.php:236-239
**Test the per-database description migration**
The existing V25 test builds its starting schemas from the current config, so those schemas already contain `description`; it also creates no `database_{sequence}` tables. It therefore cannot catch a regression in this new backfill loop—please cover a legacy schema without the attribute and assert the metadata table gains it.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.📂 Walkthrough · 7
Reviewed |
Security rulesNo new WARNING or ERROR findings from security rules. 19 existing findings tracked in
|
✨ Benchmark resultsComparing
Per-scenario breakdown & investigation detailsMetrics below reflect the current branch (after). Δ P95 compares against the base.
Top API waits (after)
|
Bring in the description schema attribute (#14471) and the SDK parameter order lock (#14469). The collection configs on this branch declare attributes with typed Attribute value objects, so main's array-shaped description entries are ported as Attribute::string(size: 1024, default: '') in the same positions; the V25 steps already go through the typed createAttributeFromCollection helpers. Co-Authored-By: Claude Opus 5.5 <[email protected]>
The API params for resource descriptions were merged into feat/description-schema by appwrite#14355 ten hours after appwrite#14471 had already merged that branch's then-tip into main, so the params never reached main. This merge brings them across. 51 files conflicted, 49 of them under the Databases module, because main refactored the attribute/column endpoints after the branch was cut. Every conflict is resolved by keeping main's structure and applying only the branch's description addition on top: - Database::VAR_* -> ColumnType::*->value (main's enum migration) - getAdapter()->getMaxUIDLength() -> getMaxUidLength() - getAdapter()->get{Min,Max}DateTime() -> getAdapter()->limits()->{min,max}DateTime - new Spatial(Database::VAR_*) -> new Spatial(ColumnType::*->value) tests/e2e/Services/Databases/DatabasesBase.php is rebuilt from main's version plus the branch's five new description tests, ported to main's enums and Id::unique() casing, because git had interleaved the branch's new tests with three main-only tests added in the same region. Co-Authored-By: Claude Opus 5 <[email protected]>
What does this PR do?
This is the schema half of #14355, split out so it can merge first. It adds an optional
descriptionstring attribute (size 1024, default'', not required) to:functions,sites,variables,databases,attributes,indexeskeys,webhookscommon.php):buckets,topicsdatabase_{sequence}) template indatabases.phpandvectorsdb.phpV25 adds the attribute to existing installs. For the per-database metadata collections it walks every database in the project, using
createAttributeFromCollection(..., from: 'collections'). The migration helpers now mapfrom: 'collections'to thedatabasesconfig group, the same wayfrom: 'files'already maps tobuckets.No endpoint reads or writes
descriptionyet, and no response model exposes it. Every new document stores the default'', and responses look the same as before. The params, response model fields,searchchanges and tests stay in #14355, which is now stacked on this branch.Why ship it first: the collection templates create the column on every new database, collection and project. Until the templates have it, anything created after the columns were backfilled on an existing install comes up without the column. That would break the API change once it lands.
MariaDB row widths after the change, from #14355 (
getAttributeWidth(), 65,535-byte limit):sites43,151,variables41,420,functions37,226,attributes19,899,indexes18,654,webhooks18,530,databases15,813,keys11,353, metadatacollections8,295,buckets5,772,topics5,762.Test Plan
app/config/collections/*andsrc/Appwrite/Migration/*hunks of feat: add description to functions, sites, variables, keys, webhooks and databases #14355, applied unchanged to currentmain. On feat: add description to functions, sites, variables, keys, webhooks and databases #14355 they passed Unit and the PostgreSQL E2E lanes.V25Test::testAddsPushBrokerSchemaToProjectFromPreviousReleasebuilds every project collection from the config and runs V25 twice, so it exercises the new attribute ondatabases,functionsand the rest.Related PRs and Issues
Checklist
🤖 Generated with Claude Code