You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/guides/configuration.md
+111Lines changed: 111 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -381,6 +381,117 @@ Example showing default values:
381
381
)
382
382
```
383
383
384
+
385
+
### Always comparing against production
386
+
387
+
By default, SQLMesh compares the current state of project files to the target `<env>` environment when `sqlmesh plan <env>` is run. However, a common expectation is that local changes should always be compared to the production environment.
388
+
389
+
The `always_recreate_environment` boolean plan option can alter this behavior. When enabled, SQLMesh will always attempt to compare against the production environment by recreating the target environment; If `prod` does not exist, SQLMesh will fall back to comparing against the target environment.
390
+
391
+
**NOTE:**: Upon succesfull plan application, changes are still promoted to the target `<env>` environment.
Even though the second change should have been a metadata change (thus not requiring a backfill), it will still be classified as a breaking change because the comparison is against production instead of the previous development state. This is intentional and may cause additional backfills as more changes are accumulated.
493
+
494
+
384
495
### Gateways
385
496
386
497
The `gateways` configuration defines how SQLMesh should connect to the data warehouse, state backend, and scheduler. These options are in the [gateway](../reference/configuration.md#gateway) section of the configuration reference page.
This syntax tells SQLMesh to use the cross-database diffing algorithm instead of the normal within-database diffing algorithm.
260
260
261
-
After adding gateways to the table names, use `table_diff` as described above - the same options apply for specifying the join keys, decimal precision, etc. See `sqlmesh table_diff --help` for a [full list of options](../reference/cli.md#table_diff).
261
+
After adding gateways to the table names, use `table_diff` as described above - the same options apply for specifying the join keys, decimal precision, etc. See `tcloud sqlmesh table_diff --help` for a [full list of options](../reference/cli.md#table_diff).
262
262
263
263
!!! warning
264
264
@@ -273,7 +273,7 @@ A cross-database diff is broken up into two stages.
273
273
The first stage is a schema diff. This example shows that differences in column name case across the two tables are identified as schema differences:
Copy file name to clipboardExpand all lines: docs/reference/configuration.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -80,7 +80,7 @@ Configuration for the `sqlmesh plan` command.
80
80
|`enable_preview`| Indicates whether to enable [data preview](../concepts/plans.md#data-preview) for forward-only models when targeting a development environment (Default: True, except for dbt projects where the target engine does not support cloning) | Boolean | N |
81
81
|`no_diff`| Don't show diffs for changed models (Default: False) | boolean | N |
82
82
|`no_prompts`| Disables interactive prompts in CLI (Default: True) | boolean | N |
83
-
83
+
|`always_recreate_environment`| Always recreates the target environment from the environment specified in `create_from` (by default `prod`) (Default: False) | boolean | N |
84
84
## Run
85
85
86
86
Configuration for the `sqlmesh run` command. Please note that this is only applicable when configured with the [builtin](#builtin) scheduler.
0 commit comments