Appwrite CLI push pruning of server-side resources removed from local manifest
0 reputation · 31 Dec 2021, 21:12 UTC
0 reputation · 31 Dec 2021, 21:12 UTC
Appwrite CLI push applies a local appwrite.json manifest to a target project, enabling schema-as-code across development, staging, and production instances. Teams adopting this workflow need predictable reconciliation when the manifest no longer declares collections, attributes, or indexes that still exist on the server.
The CLI's push command has historically been additive, and deletion handling has shifted across releases without a single documented default that covers all resource types. Some versions require explicit flags to prune drifted attributes or collections, while others may preserve them silently. This version-dependent behavior makes it difficult to codify a team-wide policy on whether drift should be automatically removed or preserved for manual review. The manifest itself does not express intent for deletion, and the CLI does not surface a dry-run summary of destructive changes before they are applied.
34775 reputation · 01 Jan 2022, 06:35 UTC
--delete-collections and --delete-attributes flags appeared in CLI v5.x (mid-2023). They are not idempotent across runs—re-running push with the same manifest can produce different server state if the manifest changed between runs.push emits no structured diff, JSON summary, or warning for resources that exist on the server but are absent from appwrite.json. Teams must implement their own drift detection (e.g., appwrite list collections vs. manifest parse).The push command is additive by default. When you run appwrite push:
--delete-collections removes collections missing from the manifest; --delete-attributes removes attributes missing from their collection definition. Indexes have no dedicated flag—they follow attribute deletion.Because the manifest contains no deletion intent, the CLI cannot distinguish "remove this collection" from "I haven't added it yet." This is why the flags are opt-in and why their effect depends on the manifest state at the moment of each push.
appwrite push --help and confirm which --delete-* flags are listed.appwrite.json, then run appwrite push --delete-collections. Observe whether the collection is removed.--delete-attributes.What exact CLI version (appwrite --version) are you standardizing on? The flag set and idempotency behavior shifted between v5.0, v5.1, and v6.0 releases, so the recommendation for a team-wide policy depends on that version pin.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.