Check out v4 of the Fauna CLI
v4 of the Fauna CLI is now in beta. The new version introduces enhancements to the developer experience, including an improved authentication workflow. To get started, check out the CLI v4 quick start. |
fauna schema diff
Prints the diff between local, staged, or active schema.
Syntax
fauna schema diff [--active] [--[no-]color ] [--dir <value>]
[--endpoint <value>] [--environment <value>] [--help]
[--secret <value>] [--staged] [--text] [--timeout <value>]
[--url <value>]
Description
fauna schema diff
prints the diff between local and remote schema.
See Examples.
Options
Option | Description |
---|---|
|
Show the diff between the local and remote active schema. |
|
Enables or disables color formatting for the output. Color formatting is
enabled by default if the terminal supports it (determined using
chalk/supports-color). Use
|
|
A local directory of |
|
Fauna server endpoint. |
|
Environment to use from |
|
Help for |
|
Authentication secret. Overrides the
secret in Use a scoped key to interact with a child database using a parent database’s admin key. For example, with a parent database’s admin key secret of |
|
Show the diff between the remote active and remote staged schema. |
|
Display the text diff instead of the semantic diff. |
|
Connection timeout in milliseconds. |
|
Database URL. Overrides the |
Examples
Compare local to staged schema
fauna schema diff
This compares the project’s local schema to the database’s remote staged schema:
Connected to endpoint: cloud-us
Differences from the remote, staged schema to the local schema:
* Modifying collection `Customer` at collections.fsl:1:1:
* Indexes:
+ add index `byEmail`
If the database has no staged schema, the command compares the database’s local schema to the remote active schema instead:
Connected to endpoint: cloud-us
Differences from the remote schema to the local schema:
* Modifying collection `Customer` at collections.fsl:1:1 (previously defined at main.fsl:4:1):
* Indexes:
+ add index `sortedByName`
Compare local to active schema
fauna schema diff --active
Connected to endpoint: cloud-us
Differences from the remote, active schema to the local schema:
* Modifying collection `Customer` at collections.fsl:4:1:
* Indexes:
+ add index `byEmail`
Compare active to staged schema
fauna schema diff --staged
Connected to endpoint: cloud-us
Differences from the remote, active schema to the remote, staged schema:
* Modifying collection `Customer` at collections.fsl:4:1:
* Indexes:
+ add index `byEmail`
Display text diff instead of semantic diff
Use --text
to show a textual difference instead of a semantic one:
fauna schema diff --text
Connected to endpoint: cloud-us
Differences from the remote, staged schema to the local schema:
collections.fsl
@ line 1 to 7
collection Customer {
email: String
+
+ index byEmail {
+ terms [.email]
+ }
}
Is this article helpful?
Tell Fauna how the article can be improved:
Visit Fauna's forums
or email docs@fauna.com
Thank you for your feedback!