-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Suggestions for online DDL query syntax #7604
Comments
I think I like option 1 the best. If SHOW vitess_migrations sorts by latest timestamp, I think that solves the recent problem. |
Thanks -- yeah, I was wondering whether it should always sort on ID DESC, or |
(normally migrations are executed first-come-first-served, so all three sort methods should return same list. ut if one migration fails, or cancelled, it's possible to pursue the next one, and that's how things get out of order) |
I think the most common case would be Would the |
On that note,
I'll look into it. Maybe not at first. |
#7638 introduces |
It's going to be complicated, because on a multi sharded keyspace that means sorting/limit on the vtgate side. For now I'm not going to try to address this. |
#7656 introduces |
#7663 introduces |
We have used suggestion (1) for all syntax. |
We wish to supply SQL syntax for Online DDL (and possibly align that with
VSCHEMA
/VINDEX
syntax). Right now it is only possible to submit a migration via SQL, but not to track/control it. Tracking/control are possible viavtctl
.In this issue we propose syntax that is SQL/MySQL idiomatic. We need syntax for:
Suggestion 1
Discussion:
SHOW TABLES...
andALTER TABLE
.SHOW
commands are mostly generic. Showing the status of a specific migration is more useful than others, hence specializedLIKE
syntax.RETRY/CANCEL
we useALTER
because we are, in fact, changing the migration state, or rather controlling it (anecdotally, behind the scenes this is implemented withUPDATE _vt.schema_migrations
)REVERT
has its own syntax because:ALTER
of an existing migration: it's the creation of a new migration, with new Job ID, that reverts a previous migration.vtctl OnlineDDL commerce show recent
). But in the above, implementation forRECENT
is cumbersome (WHERE started_timestamp > NOW() - INTERVAL 7 DAY
).Suggestion 2
Use more verbose syntax:
In the above we have specialized syntax for showing migrations per filter.
RECENT
Suggestion 3
Less English, more SQL-ish?
Like (2), but putting the commands last.
Soliciting opinions
Tracking issue: #6926
cc @vitessio/ps-vitess
The text was updated successfully, but these errors were encountered: