@tailor-platform/sdk 2.37.0 → 2.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +60 -0
- package/dist/{application-83WVdH85.mjs → application-Bz80INH4.mjs} +1 -1
- package/dist/application-CeqD1OK-.mjs +207 -0
- package/dist/application-CeqD1OK-.mjs.map +1 -0
- package/dist/cli/commands/deploy/deploy.d.mts +1 -0
- package/dist/cli/commands/deploy/tailordb/migration-validation.d.mts +2 -0
- package/dist/cli/lib.d.mts +2 -2
- package/dist/cli/lib.mjs +1 -1
- package/dist/cli/lib.mjs.map +1 -1
- package/dist/cli/main.mjs +66 -60
- package/dist/cli/main.mjs.map +1 -1
- package/dist/cli/shared/args.d.mts +14 -5
- package/dist/cli/shared/client.d.mts +14 -3
- package/dist/cli/shared/error-json.d.mts +12 -26
- package/dist/client-CHXix4LD.mjs +1 -0
- package/dist/client-DOQv-BP8.mjs +2 -0
- package/dist/client-DOQv-BP8.mjs.map +1 -0
- package/dist/completion/zsh-worker.zsh +133 -69
- package/dist/configure/services/executor/operation.d.mts +5 -4
- package/dist/configure/services/http-adapter/http-adapter.d.mts +1 -1
- package/dist/configure/services/index.d.mts +0 -1
- package/dist/configure/services/tailordb/types.d.mts +9 -0
- package/dist/context-DSi5kfqr.mjs +23 -0
- package/dist/context-DSi5kfqr.mjs.map +1 -0
- package/dist/context-OOASEQLA.mjs +1 -0
- package/dist/{crashreport-D_wf4GZh.mjs → crashreport-CQTAlnbA.mjs} +2 -2
- package/dist/{crashreport-D_wf4GZh.mjs.map → crashreport-CQTAlnbA.mjs.map} +1 -1
- package/dist/crashreport-GRnWyDnF.mjs +1 -0
- package/dist/{errors-Dmdnq0zi.mjs → errors-9OOL3xOM.mjs} +6 -5
- package/dist/errors-9OOL3xOM.mjs.map +1 -0
- package/dist/field_behavior_pb-B196sUx6.mjs +2 -0
- package/dist/field_behavior_pb-B196sUx6.mjs.map +1 -0
- package/dist/{kysely-type-DVL90_oX.mjs → kysely-type-DhAZqdQg.mjs} +14 -10
- package/dist/kysely-type-DhAZqdQg.mjs.map +1 -0
- package/dist/notification_resource_pb-BZ0hCA01.mjs +1 -0
- package/dist/notification_resource_pb-Dwzah7gO.mjs +2 -0
- package/dist/notification_resource_pb-Dwzah7gO.mjs.map +1 -0
- package/dist/plugin/builtin/kysely-type/index.mjs +1 -1
- package/dist/register-ts-hook-CXYYYgCl.mjs +1094 -0
- package/dist/register-ts-hook-CXYYYgCl.mjs.map +1 -0
- package/dist/repl-editor-Bposemei.mjs +2 -0
- package/dist/repl-editor-Bposemei.mjs.map +1 -0
- package/dist/resource_pb-elY668ZB.mjs +2 -0
- package/dist/resource_pb-elY668ZB.mjs.map +1 -0
- package/dist/{secret-file-DiuEcLFP.mjs → secret-file-CSXzcg4c.mjs} +2 -2
- package/dist/{secret-file-DiuEcLFP.mjs.map → secret-file-CSXzcg4c.mjs.map} +1 -1
- package/dist/service-B2vx6CGM.mjs +2 -0
- package/dist/{service-DDrbdyd-.mjs.map → service-B2vx6CGM.mjs.map} +1 -1
- package/dist/service-DB-RHn25.mjs +9 -0
- package/dist/service-DB-RHn25.mjs.map +1 -0
- package/dist/service-DsAWXbVX.mjs +1 -0
- package/dist/service_pb-Bethc2NW.mjs +1 -0
- package/dist/service_pb-CfpSriCy.mjs +2 -0
- package/dist/service_pb-CfpSriCy.mjs.map +1 -0
- package/dist/validation-errors-DqCeUW4L.mjs +3 -0
- package/dist/validation-errors-DqCeUW4L.mjs.map +1 -0
- package/{LICENSE → dist/vendor/graphql/LICENSE} +6 -6
- package/dist/vendor/graphql/language/KindTypeMap.d.mts +3 -0
- package/dist/vendor/graphql/language/ast.d.mts +784 -0
- package/dist/vendor/graphql/language/kinds_.d.mts +203 -0
- package/dist/vendor/graphql/language/source.d.mts +46 -0
- package/dist/vendor/graphql/language/tokenKind.d.mts +35 -0
- package/dist/workspace_resource_pb-Cow7mrJY.mjs +2 -0
- package/dist/workspace_resource_pb-Cow7mrJY.mjs.map +1 -0
- package/docs/cli/application.md +13 -9
- package/docs/cli/notification.md +128 -0
- package/docs/cli/tailordb.md +26 -57
- package/docs/cli/workspace.md +1 -1
- package/docs/cli-reference.md +228 -48
- package/docs/github-actions.md +162 -26
- package/docs/services/tailordb/index.md +6 -2
- package/docs/services/tailordb/migration.md +53 -56
- package/docs/testing.md +0 -1
- package/package.json +14 -10
- package/dist/application-Cida-j1g.mjs +0 -207
- package/dist/application-Cida-j1g.mjs.map +0 -1
- package/dist/configure/services/http-adapter/index.d.mts +0 -2
- package/dist/crashreport-C2AcQNTe.mjs +0 -1
- package/dist/errors-Dmdnq0zi.mjs.map +0 -1
- package/dist/kysely-type-DVL90_oX.mjs.map +0 -1
- package/dist/register-ts-hook-Ht4zCseV.mjs +0 -1115
- package/dist/register-ts-hook-Ht4zCseV.mjs.map +0 -1
- package/dist/repl-editor-DkrCZmmg.mjs +0 -2
- package/dist/repl-editor-DkrCZmmg.mjs.map +0 -1
- package/dist/service-CZ0EdD2-.mjs +0 -10
- package/dist/service-CZ0EdD2-.mjs.map +0 -1
- package/dist/service-DDrbdyd-.mjs +0 -2
- package/dist/service-WhSyhaho.mjs +0 -1
- package/dist/service_pb-BMHhVot2.mjs +0 -1
- package/dist/service_pb-BxMSK0gg.mjs +0 -2
- package/dist/service_pb-BxMSK0gg.mjs.map +0 -1
- package/dist/workspace_resource_pb-7smKERdZ.mjs +0 -2
- package/dist/workspace_resource_pb-7smKERdZ.mjs.map +0 -1
package/docs/cli/application.md
CHANGED
|
@@ -82,7 +82,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
82
82
|
|
|
83
83
|
**Notes**
|
|
84
84
|
|
|
85
|
-
Every workspace belongs to an organization; when none is given or set as a default, interactive runs ask for one and non-interactive runs fail. Workspace creation uses the selected user's default organization and folder set by `user update` when neither location is given and TAILOR_PLATFORM_TOKEN is not set. Giving --organization-id or --folder-id replaces both defaults.
|
|
85
|
+
Every workspace belongs to an organization; when none is given or set as a default, interactive runs ask for one and non-interactive runs fail. Workspace creation uses the selected user's default organization and folder set by `user update` when neither location is given and TAILOR_PLATFORM_TOKEN is not set. Giving --organization-id or --folder-id replaces both defaults. TAILOR_PLATFORM_ORGANIZATION_ID and TAILOR_PLATFORM_FOLDER_ID, including values loaded by --env-file, also replace the defaults; command-line options take precedence, and an empty value of either variable is ignored. With --create-workspace, an existing workspace must match the resolved name, region, organization, and folder to be reused.
|
|
86
86
|
|
|
87
87
|
**JSON result:**
|
|
88
88
|
|
|
@@ -183,16 +183,20 @@ Names that identify a resource across the whole workspace, such as application,
|
|
|
183
183
|
|
|
184
184
|
Each config's `files` and `ignores` patterns (see [Service Configuration](../configuration.md#service-configuration)) resolve relative to that config's own directory, not the directory you ran `deploy` from. For example, `apps/buyer/tailor.config.ts` declaring `files: ["db/**/*.ts"]` loads files from `apps/buyer/db/`, independent of where `apps/supplier/tailor.config.ts`'s patterns resolve. If a config's relative patterns match nothing under its own directory, the SDK falls back to the invocation directory and logs a warning (see [Service Configuration](../configuration.md#service-configuration) for details).
|
|
185
185
|
|
|
186
|
-
**Migration Handling:**
|
|
186
|
+
**Migration Handling (Beta):**
|
|
187
187
|
|
|
188
|
-
When migrations are configured (`db
|
|
188
|
+
When migrations are configured (`db.<namespace>.migration` in config), the `deploy` command:
|
|
189
189
|
|
|
190
|
-
1.
|
|
191
|
-
2.
|
|
192
|
-
3.
|
|
193
|
-
4.
|
|
190
|
+
1. Checks the migration files and the migration state of each namespace (see Schema Check below) three times: while planning, so `--dry-run` reports a failure too; before it applies anything for any config; and again when it applies each config's TailorDB changes. If the migration files, a checkpoint reset, or the tables to delete changed after planning, the deploy stops with `DEPLOY_PLAN_STALE`.
|
|
191
|
+
2. Resets the checkpoints that the plan showed would be reset to `0000` after a re-baseline, clears an in-progress record that an earlier deploy left on a migration it had already committed, and deletes the tables that a committed migration removed but an earlier deploy did not delete.
|
|
192
|
+
3. Applies the changes of namespaces without pending migrations, except deletions. This also takes their tables out of a maintenance mode that an interrupted deploy left.
|
|
193
|
+
4. Puts every namespace with pending migrations into maintenance mode, unless `maintenanceMode` is `false`.
|
|
194
|
+
5. Runs the pending migrations one namespace at a time, in alphabetical order of the namespace names, and in number order within a namespace. Each migration applies its pre-migration schema, runs its `migrate.ts`, applies its post-migration schema, advances the checkpoint, and then deletes the tables and GraphQL permissions it removed.
|
|
195
|
+
6. With `--no-schema-check`, applies the local table definitions that the pending migrations do not include (see [Schema verification](../services/tailordb/migration.md#schema-verification)).
|
|
196
|
+
7. Takes the tables out of maintenance mode, or with `maintenanceMode: "deploy"`, leaves that to the end of the deploy.
|
|
197
|
+
8. Deletes the remaining tables and GraphQL permissions that are no longer in the config.
|
|
194
198
|
|
|
195
|
-
See [Automatic Migration Execution](../services/tailordb/migration.md#automatic-migration-execution) for details on automatic migration execution.
|
|
199
|
+
See [Automatic Migration Execution](../services/tailordb/migration.md#automatic-migration-execution) for details on automatic migration execution, and [Several configs in one deploy](../services/tailordb/migration.md#several-configs-in-one-deploy) for the state a failed migration leaves the other configs in.
|
|
196
200
|
|
|
197
201
|
**Concurrent Deploys:**
|
|
198
202
|
|
|
@@ -207,7 +211,7 @@ By default, `deploy` performs two verification steps:
|
|
|
207
211
|
|
|
208
212
|
If remote schema drift is detected, the deploy will fail with an error showing the differences. This helps prevent applying migrations to an inconsistent state.
|
|
209
213
|
|
|
210
|
-
Use `--no-schema-check` to skip both verifications (not recommended for production). It does not skip the check that the remote migration checkpoint is in the local migration history: when the deployed checkpoint is ahead of the local migration files or belongs to another migration history, the deploy stops before changing anything. Pull the latest migration files, or move the checkpoint on purpose with `tailor tailordb migration sync
|
|
214
|
+
Use `--no-schema-check` to skip both verifications (not recommended for production). It does not skip the check that the remote migration checkpoint is in the local migration history: when the deployed checkpoint is ahead of the local migration files or belongs to another migration history, the deploy stops before changing anything. Pull the latest migration files, or move the checkpoint on purpose with `tailor tailordb migration sync`, adding `--force` when the checkpoint belongs to another migration history or has a history label that cannot be read, then deploy again.
|
|
211
215
|
|
|
212
216
|
**Plan Output:**
|
|
213
217
|
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: "List, read and dismiss the platform notifications sent to you from the tailor CLI."
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Notification Commands
|
|
6
|
+
|
|
7
|
+
Commands for reading the platform notifications addressed to you: alerts you must act on,
|
|
8
|
+
incidents, maintenance notices and announcements. The inbox is per user, so these commands take a
|
|
9
|
+
profile (for its login) but no workspace. Marking a notification read or dismissing it in the CLI
|
|
10
|
+
also changes it in the Console, which shows the same inbox.
|
|
11
|
+
|
|
12
|
+
When no subcommand is provided, defaults to `list`.
|
|
13
|
+
|
|
14
|
+
## notification
|
|
15
|
+
|
|
16
|
+
Read the platform notifications sent to you.
|
|
17
|
+
|
|
18
|
+
**Usage**
|
|
19
|
+
|
|
20
|
+
```
|
|
21
|
+
tailor notification [command]
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
25
|
+
|
|
26
|
+
**Commands**
|
|
27
|
+
|
|
28
|
+
| Command | Description |
|
|
29
|
+
| ----------------------------------------------- | ---------------------------------------- |
|
|
30
|
+
| [`notification list`](#notification-list) | List the notifications in your inbox. |
|
|
31
|
+
| [`notification read`](#notification-read) | Show a notification and mark it as read. |
|
|
32
|
+
| [`notification dismiss`](#notification-dismiss) | Remove a notification from your inbox. |
|
|
33
|
+
|
|
34
|
+
### notification dismiss
|
|
35
|
+
|
|
36
|
+
Remove a notification from your inbox.
|
|
37
|
+
|
|
38
|
+
**Usage**
|
|
39
|
+
|
|
40
|
+
```
|
|
41
|
+
tailor notification dismiss [options] <id>
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
**Arguments**
|
|
45
|
+
|
|
46
|
+
| Argument | Description | Required |
|
|
47
|
+
| -------- | --------------- | -------- |
|
|
48
|
+
| `id` | Notification ID | Yes |
|
|
49
|
+
|
|
50
|
+
**Options**
|
|
51
|
+
|
|
52
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
53
|
+
| --------------------- | ----- | ----------------- | -------- | ------- | ------------------------- |
|
|
54
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
55
|
+
|
|
56
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
57
|
+
|
|
58
|
+
### notification list
|
|
59
|
+
|
|
60
|
+
List the notifications in your inbox.
|
|
61
|
+
|
|
62
|
+
**Usage**
|
|
63
|
+
|
|
64
|
+
```
|
|
65
|
+
tailor notification list [options]
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
**Options**
|
|
69
|
+
|
|
70
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
71
|
+
| ------------------------------------------- | ----- | --------------------------------------------------------------- | -------- | -------- | ------------------------- |
|
|
72
|
+
| `--order <ORDER>` | - | Sort order (asc or desc) | No | `"desc"` | - |
|
|
73
|
+
| `--limit <LIMIT>` | `-l` | Maximum number of items to return (0: unlimited) | No | `50` | - |
|
|
74
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
75
|
+
| `--category <CATEGORY>` | - | Only this category (alert, incident, maintenance, announcement) | No | - | - |
|
|
76
|
+
| `--severity <SEVERITY>` | - | Only this severity or higher (info, warning, critical) | No | - | - |
|
|
77
|
+
| `--unread` | - | Only unread notifications | No | `false` | - |
|
|
78
|
+
| `--scope-workspace <SCOPE_WORKSPACE>` | - | Only notifications about this workspace ID | No | - | - |
|
|
79
|
+
| `--scope-organization <SCOPE_ORGANIZATION>` | - | Only notifications about this organization ID | No | - | - |
|
|
80
|
+
|
|
81
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
82
|
+
|
|
83
|
+
### notification read
|
|
84
|
+
|
|
85
|
+
Show a notification and mark it as read.
|
|
86
|
+
|
|
87
|
+
**Usage**
|
|
88
|
+
|
|
89
|
+
```
|
|
90
|
+
tailor notification read [options] <id>
|
|
91
|
+
```
|
|
92
|
+
|
|
93
|
+
**Arguments**
|
|
94
|
+
|
|
95
|
+
| Argument | Description | Required |
|
|
96
|
+
| -------- | ---------------------------- | -------- |
|
|
97
|
+
| `id` | Notification ID (repeatable) | Yes |
|
|
98
|
+
|
|
99
|
+
**Options**
|
|
100
|
+
|
|
101
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
102
|
+
| --------------------- | ----- | ------------------------------------------------ | -------- | ------- | ------------------------- |
|
|
103
|
+
| `--no-mark-read` | - | Show the notification without marking it as read | No | `false` | - |
|
|
104
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
105
|
+
|
|
106
|
+
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
107
|
+
|
|
108
|
+
**Output (default):**
|
|
109
|
+
|
|
110
|
+
```
|
|
111
|
+
┌──────────────────────────────────────┬──────────┬──────────────┬─────────────────────────────────┬─────────────┬────────────┐
|
|
112
|
+
│ id │ severity │ category │ title │ arrivedAt │ readAt │
|
|
113
|
+
├──────────────────────────────────────┼──────────┼──────────────┼─────────────────────────────────┼─────────────┼────────────┤
|
|
114
|
+
│ 0d2c0f1e-5c2b-4e3a-9c1d-2f6a7b8c9d0e │ warning │ maintenance │ Scheduled maintenance on Nov 3 │ 2 hours ago │ unread │
|
|
115
|
+
│ 1d2c0f1e-5c2b-4e3a-9c1d-2f6a7b8c9d0e │ info │ announcement │ Platform notifications are live │ 3 days ago │ 2 days ago │
|
|
116
|
+
└──────────────────────────────────────┴──────────┴──────────────┴─────────────────────────────────┴─────────────┴────────────┘
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
`tailor notification read <id>` prints the title, the metadata, the body as plain text (it is
|
|
120
|
+
Markdown, shown as written) and the action links, then marks the notification read. Pass
|
|
121
|
+
`--no-mark-read` to only display it. Several IDs can be given at once. If some of them are not
|
|
122
|
+
found, the others are still shown and marked read, and the command then fails naming the missing
|
|
123
|
+
IDs. With a read-only login, the notifications are shown but not marked read, and a warning says
|
|
124
|
+
so.
|
|
125
|
+
|
|
126
|
+
`tailor notification dismiss <id>` removes a notification from your inbox. This cannot be undone:
|
|
127
|
+
`read` and `list` no longer show it. It needs a profile that is not read-only. Notifications you
|
|
128
|
+
do not dismiss stay until the platform expires or revokes them.
|
package/docs/cli/tailordb.md
CHANGED
|
@@ -98,17 +98,16 @@ tailor tailordb migration <command>
|
|
|
98
98
|
|
|
99
99
|
**Commands**
|
|
100
100
|
|
|
101
|
-
| Command | Description
|
|
102
|
-
| ----------------------------------------------------------------- |
|
|
103
|
-
| [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot.
|
|
104
|
-
| [`tailordb migration rebaseline`](#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline.
|
|
105
|
-
| [`tailordb migration resolve`](#tailordb-migration-resolve) | Settle a migration that a failed deploy left partially applied, or whose run a deploy could not confirm.
|
|
106
|
-
| [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none.
|
|
107
|
-
| [`tailordb migration
|
|
108
|
-
| [`tailordb migration
|
|
109
|
-
| [`tailordb migration
|
|
110
|
-
| [`tailordb migration
|
|
111
|
-
| [`tailordb migration validate`](#tailordb-migration-validate) | Validate the full migration history, unreviewed generated migration scripts, and schema drift (local tables vs. migration snapshot, remote schema vs. migration checkpoint) without deploying. This includes the migration and schema-drift checks used by 'deploy' and exits with a non-zero code when issues are found. |
|
|
101
|
+
| Command | Description |
|
|
102
|
+
| ----------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
103
|
+
| [`tailordb migration generate`](#tailordb-migration-generate) | Generate migration files by detecting schema differences between current local tables and the previous migration snapshot. |
|
|
104
|
+
| [`tailordb migration rebaseline`](#tailordb-migration-rebaseline) | Collapse the full migration history into a new 0000 baseline. |
|
|
105
|
+
| [`tailordb migration resolve`](#tailordb-migration-resolve) | Settle a migration that a failed deploy left partially applied, or whose run a deploy could not confirm. |
|
|
106
|
+
| [`tailordb migration script`](#tailordb-migration-script) | Add a migration script (migrate.ts) template to an existing migration directory, or record with --no-script that a migration intentionally has none. |
|
|
107
|
+
| [`tailordb migration status`](#tailordb-migration-status) | Show the current migration status for TailorDB namespaces, including applied and pending migrations. |
|
|
108
|
+
| [`tailordb migration sync`](#tailordb-migration-sync) | Sync remote TailorDB schema and checkpoint to a local migration snapshot to recover from schema drift or a checkpoint outside the local history. |
|
|
109
|
+
| [`tailordb migration test`](#tailordb-migration-test) | Test pending migrations with seed fixtures or cloned data in a temporary workspace. |
|
|
110
|
+
| [`tailordb migration validate`](#tailordb-migration-validate) | Run the migration and schema-drift checks that 'deploy' runs before changing anything, without deploying, and exit with a non-zero code when issues are found. |
|
|
112
111
|
|
|
113
112
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
114
113
|
|
|
@@ -197,6 +196,8 @@ Use this after a deploy failed partway through a migration whose `migrate.ts` ex
|
|
|
197
196
|
|
|
198
197
|
For a run that a deploy could not confirm, the command reads how the run ended and shows it before asking for confirmation: use `--complete` when it succeeded, and `--rollback` when it failed, was canceled, or did not start. It refuses while the run is still running, and warns when the option you chose does not fit how the run ended.
|
|
199
198
|
|
|
199
|
+
`--rollback` also settles a migration that no deploy recorded as in progress, but whose pre-migration schema or maintenance mode a deploy left in place, for example because the deploy stopped before recording it. See "Settling a migration that stays in progress" in the TailorDB Migrations guide for when it runs.
|
|
200
|
+
|
|
200
201
|
Both options remove the in-progress record, take the tables out of maintenance mode, and remove the temporary resources of the failed run, so `deploy` and the other migration commands work again. As with `tailordb migration sync`, the local migration history must reproduce the current table definitions. If sending the schema stops partway, run the command again.
|
|
201
202
|
|
|
202
203
|
#### tailordb migration script
|
|
@@ -231,43 +232,6 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
231
232
|
|
|
232
233
|
When `migrate.ts` already exists, running the command clears a previously recorded `--no-script` acknowledgment, and `--with-test` adds only the tests that do not exist yet (writing `db.pglite.ts` if it is missing). `migrate.pglite.test.ts` is scaffolded only when `@electric-sql/pglite` is installed in the project.
|
|
233
234
|
|
|
234
|
-
#### tailordb migration set
|
|
235
|
-
|
|
236
|
-
Set migration checkpoint to a specific number.
|
|
237
|
-
|
|
238
|
-
**Usage**
|
|
239
|
-
|
|
240
|
-
```
|
|
241
|
-
tailor tailordb migration set [options] <number>
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
**Arguments**
|
|
245
|
-
|
|
246
|
-
| Argument | Description | Required |
|
|
247
|
-
| -------- | ----------------------------------------- | -------- |
|
|
248
|
-
| `number` | Migration number to set (e.g., 0001 or 1) | Yes |
|
|
249
|
-
|
|
250
|
-
**Options**
|
|
251
|
-
|
|
252
|
-
| Option | Alias | Description | Required | Default | Env |
|
|
253
|
-
| ------------------------------- | ----- | --------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
254
|
-
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
255
|
-
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
256
|
-
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
257
|
-
| `--yes` | `-y` | Skip confirmation prompts | No | `false` | - |
|
|
258
|
-
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (required if multiple namespaces exist) | No | - | - |
|
|
259
|
-
| `--force` | - | Proceed even when the namespace records a migration history ID other than the local one | No | `false` | - |
|
|
260
|
-
|
|
261
|
-
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
262
|
-
|
|
263
|
-
**Notes**
|
|
264
|
-
|
|
265
|
-
The migration number must be a 4-digit value (e.g. `0001`) or a bare integer (e.g. `1`) within 0–9999, and must exist in the local migration history; `0` is always accepted as the baseline, provided the local history passes validation. A gapped history is rejected.
|
|
266
|
-
|
|
267
|
-
The command refuses to run when the namespace records a migration history ID other than the local one, or one that cannot be read, unless the namespace has neither a checkpoint nor a history ID yet. `--force` replaces that history ID with the local one, or removes it when the local history has none, and still asks for confirmation unless `--yes` is given.
|
|
268
|
-
|
|
269
|
-
Metadata lookup failures (authentication, permission, or network errors) are reported as errors; only a not-yet-deployed namespace is treated as having no checkpoint.
|
|
270
|
-
|
|
271
235
|
#### tailordb migration status
|
|
272
236
|
|
|
273
237
|
Show the current migration status for TailorDB namespaces, including applied and pending migrations.
|
|
@@ -359,11 +323,11 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
359
323
|
|
|
360
324
|
**Notes**
|
|
361
325
|
|
|
362
|
-
The source workspace is read-only. Without --target-workspace-id, the command creates a workspace in the source workspace's region and deletes it after success or failure; pass --keep to retain it for inspection. Right after creating the workspace it records a 24h expiry (unless --keep is given without --keep-ttl), so if the run is interrupted before the command can delete the workspace, workspace prune --expired removes it later. A designated target is retained and requires --yes. Clone mode copies TailorDB records only; it does not copy IdP users or file blobs. With --keep-ttl, the kept workspace records an expiry; it is not deleted automatically, but workspace prune --expired removes it once the expiry has passed.
|
|
326
|
+
The source workspace is read-only. Without --target-workspace-id, the command creates a workspace in the source workspace's region and deletes it after success or failure; pass --keep to retain it for inspection. Right after creating the workspace it records a 24h expiry (unless --keep is given without --keep-ttl), so if the run is interrupted before the command can delete the workspace, workspace prune --expired removes it later. A designated target is retained and requires --yes. Clone mode copies TailorDB records only; it does not copy IdP users or file blobs. With --keep-ttl, the kept workspace records an expiry; it is not deleted automatically, but workspace prune --expired removes it once the expiry has passed. Command-line options take precedence over TAILOR_PLATFORM_ORGANIZATION_ID and TAILOR_PLATFORM_FOLDER_ID, including values loaded by --env-file, and an empty value of either variable is ignored.
|
|
363
327
|
|
|
364
328
|
#### tailordb migration validate
|
|
365
329
|
|
|
366
|
-
|
|
330
|
+
Run the migration and schema-drift checks that 'deploy' runs before changing anything, without deploying, and exit with a non-zero code when issues are found.
|
|
367
331
|
|
|
368
332
|
**Usage**
|
|
369
333
|
|
|
@@ -373,16 +337,21 @@ tailor tailordb migration validate [options]
|
|
|
373
337
|
|
|
374
338
|
**Options**
|
|
375
339
|
|
|
376
|
-
| Option
|
|
377
|
-
|
|
|
378
|
-
| `--workspace-id <WORKSPACE_ID>`
|
|
379
|
-
| `--profile <PROFILE>`
|
|
380
|
-
| `--config <CONFIG>`
|
|
381
|
-
| `--namespace <NAMESPACE>`
|
|
382
|
-
| `--strict`
|
|
340
|
+
| Option | Alias | Description | Required | Default | Env |
|
|
341
|
+
| ----------------------------------------------- | ----- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------- | -------------------- | ------------------------------ |
|
|
342
|
+
| `--workspace-id <WORKSPACE_ID>` | `-w` | Workspace ID | No | - | `TAILOR_PLATFORM_WORKSPACE_ID` |
|
|
343
|
+
| `--profile <PROFILE>` | `-p` | Workspace profile | No | - | `TAILOR_PLATFORM_PROFILE` |
|
|
344
|
+
| `--config <CONFIG>` | `-c` | Path to Tailor config file | No | `"tailor.config.ts"` | `TAILOR_CONFIG_PATH` |
|
|
345
|
+
| `--namespace <NAMESPACE>` | `-n` | Target TailorDB namespace (validates all namespaces if not specified) | No | - | - |
|
|
346
|
+
| `--strict` | - | Also fail when a pending migration can drop data without an acknowledgment | No | `false` | - |
|
|
347
|
+
| `--migration-skip-steps <MIGRATION_SKIP_STEPS>` | - | Also check that 'deploy --migration-skip-steps' can skip these steps of a partially applied multi-step migration, as comma-separated namespace/step entries | No | - | - |
|
|
383
348
|
|
|
384
349
|
See [Global Options](../cli-reference.md#global-options) for options available to all commands.
|
|
385
350
|
|
|
351
|
+
**Notes**
|
|
352
|
+
|
|
353
|
+
Migration scripts are checked across the full migration history, not only the pending migrations that `deploy` checks. Like `deploy`, the command bundles only the pending scripts and checks the machine user that runs them.
|
|
354
|
+
|
|
386
355
|
**See also:** For migration concepts, configuration, workflow, and troubleshooting, see the [TailorDB Migrations guide](../services/tailordb/migration.md).
|
|
387
356
|
|
|
388
357
|
### tailordb erd (Beta)
|
package/docs/cli/workspace.md
CHANGED
|
@@ -123,7 +123,7 @@ See [Global Options](../cli-reference.md#global-options) for options available t
|
|
|
123
123
|
|
|
124
124
|
Every workspace belongs to an organization. Without --organization-id and --folder-id, on the command line or through TAILOR_PLATFORM_ORGANIZATION_ID / TAILOR_PLATFORM_FOLDER_ID, the workspace is created in the default organization and folder that the logged-in user set with `user update`, unless TAILOR_PLATFORM_TOKEN is set. When none of these gives an organization, the command fails. Giving either option replaces both defaults, and --folder-id requires --organization-id.
|
|
125
125
|
|
|
126
|
-
|
|
126
|
+
Command-line options take precedence over TAILOR_PLATFORM_ORGANIZATION_ID and TAILOR_PLATFORM_FOLDER_ID, including values loaded by --env-file. An empty value of either variable is treated as not given.
|
|
127
127
|
|
|
128
128
|
When --ttl is given but the expiry cannot be confirmed, the command still prints the created workspace, then fails with WORKSPACE_TTL_WRITE_FAILED. With --json, the printed `ttl.state` is then `unconfirmed` instead of `written`, so a script can read the workspace ID and record the expiry again with `workspace ttl set`.
|
|
129
129
|
|