Skip to content

feat: add the description attribute to the collection schema - #14471

Merged
Meldiron merged 1 commit into
mainfrom
feat/description-schema
Oct 14, 2026
Merged

Meldiron merged 1 commit into
mainfrom
feat/description-schema

Conversation

@Meldiron

Copy link
Copy Markdown
Contributor

What does this PR do?

This is the schema half of #14355, split out so it can merge first. It adds an optional description string attribute (size 1024, default '', not required) to:

  • project: functions, sites, variables, databases, attributes, indexes
  • console: keys, webhooks
  • both project and console (common.php): buckets, topics
  • the per-database metadata collection (database_{sequence}) template in databases.php and vectorsdb.php

V25 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 map from: 'collections' to the databases config group, the same way from: 'files' already maps to buckets.

No endpoint reads or writes description yet, and no response model exposes it. Every new document stores the default '', and responses look the same as before. The params, response model fields, search changes 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): sites 43,151, variables 41,420, functions 37,226, attributes 19,899, indexes 18,654, webhooks 18,530, databases 15,813, keys 11,353, metadata collections 8,295, buckets 5,772, topics 5,762.

Test Plan

Related PRs and Issues

Checklist

  • Have you read the Contributing Guidelines on issues?
  • If the PR includes a change to an API's metadata (desc, label, params, etc.), does it also include updated API specs and example docs? (No API metadata changes.)

🤖 Generated with Claude Code

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]>
@luxor-code-review

luxor-code-review Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Review complete. No blocking issues — approved ✅; 1 nitpick below.

🧹 Nitpicks (1) — 🟢 1 low
  • 🟢 VectorsDB collections gains description with no migration (vectorsdb.php:44) — The PR adds a description attribute to the VectorsDB collections metadata schema, but V25::migrateCollections() only iterates the console and projects collection types and no migration path touches the vectors adapter (src/Appwrite/Migration/Version/V25.php:42-47), unlike the DocumentsDB path which backfills every database_N table.

The change stages a description metadata field for future API work: it adds the attribute definition to ten collection configs and backfills it in migration V25 for webhooks, databases (plus per-database database_* tables via a new collections → databases collectionType mapping in all three Migration::create*FromCollection helpers), functions, sites, attributes, indexes, variables, keys, buckets, and topics. Migration cases are correctly guarded per collection type, and the additive column is backward-compatible.

Files Change
app/config/collections/{common,platform,projects,databases,vectorsdb}.php Add a description string attribute (1024, required false, default '') to buckets, topics, keys, webhooks, databases, attributes, indexes, functions, sites, variables, and the per-database collections templates
src/Appwrite/Migration/Migration.php Map $from = 'collections' to the databases collectionType in createAttributesFromCollection, createAttributeFromCollection, and createIndexFromCollection
src/Appwrite/Migration/Version/V25.php Create the description attribute during migration for all affected collections, including per-database metadata tables

Reviewed commit: 33ee90d

@ghost

ghost commented Oct 14, 2026

Copy link
Copy Markdown

🔵 Tier A · Mergeable after minor fixes

The migration behavior is not covered by a regression test, though the change is otherwise schema and migration work.

Adds an optional description attribute to project, console, shared, and per-database collection schemas. V25 adds the attribute to existing collections and database metadata tables during migration.

Verdict New comments Fixed Still open
✅ Approved 1 0 0
Finding Where
🟡 Test the per-database description migration src/Appwrite/Migration/Version/V25.php:236
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
File Change
app/config/collections/common.php Adds description to the shared buckets and topics schemas.
app/config/collections/databases.php Adds description to the per-database collections template.
app/config/collections/platform.php Adds description to console keys and webhooks.
app/config/collections/projects.php Adds description to project functions, sites, variables, databases, attributes, and indexes.
app/config/collections/vectorsdb.php Adds description to the VectorsDB collections template.
src/Appwrite/Migration/Migration.php Maps from: collections to the databases schema group for migration helpers.
src/Appwrite/Migration/Version/V25.php Adds V25 migration steps for the new description attributes, including per-database metadata collections.

Reviewed 33ee90d · Details · Comment @hansi-codes review to re-run, or mention @hansi-codes with a question.

@ghost ghost left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔵 Tier A · Looks good to merge. Summary

Comment thread src/Appwrite/Migration/Version/V25.php Resolved
@github-actions

Copy link
Copy Markdown

Security rules

No new WARNING or ERROR findings from security rules.

19 existing findings tracked in .semgrep/baseline.json
  • php.appwrite.guest-write-without-abuse-limit (12)
  • php.appwrite.secret-compare-timing (5)
  • php.appwrite.weak-secret-env-default (2)

Posted by Checks / Rules. Re-runs update this comment in place. Rule details and baseline: .semgrep/README.md.

@github-actions

Copy link
Copy Markdown

✨ Benchmark results

Comparing main (before) → feat/description-schema (after).

Metric Before After Change
🚀 Requests/sec 192.99 186.71 ⚪ -3.3%
⏱️ Latency P50 88.4 ms 94.89 ms 🔴 +7.3%
⏱️ Latency P95 208.87 ms 211.99 ms ⚪ +1.5%
Per-scenario breakdown & investigation details

Metrics below reflect the current branch (after). Δ P95 compares against the base.

Scenario P50 (ms) P95 (ms) Requests RPS Δ P95 (ms)
API total 94.89 211.99 11,628 186.71 +3.12
Account 178.35 343.08 612 10.14 +11.29
TablesDB 92.72 163.25 6,324 103.3 -0.28
Storage 85.71 188.52 3,060 52.17 +13.33
Functions 128.74 266.2 1,632 28.58 +16.59

Top API waits (after)

API request Max wait (ms)
account.name.update 516.69
functions.variables.update 462.03
account.prefs.update 436.21
functions.create 404.7
tablesdb.rows.create 353.33

@Meldiron
Meldiron merged commit 79ad1a2 into main Oct 14, 2026
67 checks passed
abnegate added a commit that referenced this pull request Oct 14, 2026
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]>
NancyWei123 pushed a commit to NancyWei123/appwrite that referenced this pull request Oct 16, 2026
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]>
@ChiragAgg5k ChiragAgg5k mentioned this pull request Oct 21, 2026
6 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant