Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -481,10 +481,11 @@ External create required flags: `--host`, `--source-database`, `--username`, `--

Copy tables between keyspaces with `pscale branch vtctld move-tables`. `pscale workflow` will be deprecated soon; prefer `move-tables` for new work. JSON output includes `next_steps` — follow those commands. Typical order: create the target keyspace (`keyspace create` or `keyspace create-external`), create the workflow, poll `status`, switch replica traffic, then primary traffic (ask the user first), then `complete --dry-run` and `complete` after approval. Create with `--auto-start=false` to leave streams stopped, then `start` when you are ready.

`--workflow` is the workflow name you choose. `--source-keyspace` and `--target-keyspace` are required on create. Pass `--tables t1,t2` or `--all-tables` (mutually exclusive).
`--workflow` is the workflow name you choose. `--source-keyspace` and `--target-keyspace` are required on create. Pass `--tables t1,t2` or `--all-tables` (mutually exclusive). `list` without `--target-keyspace` returns workflows in every keyspace on the branch.

```bash
pscale branch vtctld move-tables list <database> <branch> --org <org> --format json
pscale branch vtctld move-tables list <database> <branch> --org <org> --format json --target-keyspace <target>
pscale branch vtctld move-tables create <database> <branch> --org <org> --format json \
--workflow <workflow> --source-keyspace <source> --target-keyspace <target> --tables <table>
pscale branch vtctld move-tables create <database> <branch> --org <org> --format json \
Expand Down
2 changes: 1 addition & 1 deletion internal/cmd/branch/vtctld/move_tables.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func MoveTablesListCmd(ch *cmdutil.Helper) *cobra.Command {
},
}

cmd.Flags().StringVar(&flags.targetKeyspace, "target-keyspace", "", "Target keyspace (defaults to the branch's default keyspace)")
cmd.Flags().StringVar(&flags.targetKeyspace, "target-keyspace", "", "Filter by target keyspace (lists all keyspaces if omitted)")

return cmd
}
Expand Down
3 changes: 3 additions & 0 deletions internal/cmd/branch/vtctld/move_tables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -663,6 +663,9 @@ func TestMoveTablesListWithoutTargetKeyspace(t *testing.T) {
},
}

listCmd := MoveTablesListCmd(moveTablesTestHelper(org, svc, nil, nil))
c.Assert(listCmd.Flags().Lookup("target-keyspace").Usage, qt.Contains, "lists all keyspaces if omitted")

var buf bytes.Buffer
ch := moveTablesTestHelper(org, svc, nil, &buf)

Expand Down
Loading