Repository navigation
Conversation
…DSQL Mirrors awslabs/agent-plugins, the canonical home for DSQL agent steering. Aurora DSQL shipped ALTER TABLE ... DROP COLUMN on 2026-08-03, but this repo still asserted "DSQL does NOT support direct ... DROP COLUMN" and routed the operation through the destructive Table Recreation Pattern. DROP COLUMN is synchronous and metadata-only. Unlike VALIDATE CONSTRAINT it has no ALTER TABLE ASYNC form and returns no job_id. Both surfaces updated: - skills/dsql-skill/ (SKILL.md + references/) -- source of truth. The five alias SKILL.md files were regenerated by the sync-dsql-skill-aliases hook, not hand-edited. - kiro_power/ (POWER.md + steering/) -- translated to the flat steering layout. steering/*.md stays byte-identical to its references/ counterpart. Content changes match agent-plugins: the rule lands in the always-loaded development-guide, column-operations documents the native statement with the PK/CASCADE/column-budget rules, and the workflow leads with the native path. The "DSQL does NOT support direct ..." sentence is now affirmative, matching the canonical wording and house style. Table recreation is unchanged for ALTER COLUMN TYPE, SET NOT NULL, DROP CONSTRAINT, and MODIFY PRIMARY KEY.
mripley
requested review from
a team,
Benjscho,
amaksimo,
anwesham-lab,
pkale,
praba2210 and
spencercorwin
as code owners
August 28, 2026 20:15
Member
|
closing in favor of skill deprecation the agent plugin will be the sole source of truth |
praba2210
pushed a commit
to awslabs/aurora-dsql-orms
that referenced
this pull request
Oct 7, 2026
…MN (#600) ## Summary `test_aerich_add_column_migration` skipped its downgrade half behind this comment: ```python # Note: Downgrade not tested here because DSQL doesn't support ALTER TABLE DROP COLUMN. # See other tests for downgrade testing. ``` Aurora DSQL has supported `ALTER TABLE ... DROP COLUMN` since [2026-08-03](https://docs.aws.amazon.com/aurora-dsql/latest/userguide/release-notes.html), so the note is stale — and it was suppressing real coverage: the aerich downgrade path for a column-adding migration was going untested. ## Changes - Capture the `Command` returned by `migrate_to()` so `downgrade()` can be called on it. The original code discarded the return value, so there was no handle to downgrade with. - Downgrade and assert the added column is gone while its sibling survives. This follows the shape already used by `test_aerich_add_model_and_downgrade_last` and `test_aerich_multi_model_migration` — same `command = await migrate_to(...)` capture, same `downgrade(version=-1, delete=False)` call, same connection re-fetch and assertion style. Column-level assertions use the existing `get_table_columns()` helper (as this test already does) rather than the `table_exists` the model-level siblings use, since this migration adds a column rather than a table. No new helper, fixture, or marker. ## Why the emitted SQL is safe on DSQL aerich's `Migrate._remove_field` calls `ddl.drop_column`, and `PostgresDDL` inherits the base template `ALTER TABLE "{table_name}" DROP COLUMN "{column_name}"` — no `CASCADE`, no MySQL-style quoting. `aurora_dsql_tortoise/aerich/patch.py` does not intercept drops, so it reaches DSQL as a single-statement DDL, which is what DSQL requires. The column here is an ordinary non-key column, so it avoids the one restriction that remains: dropping a primary key column is still unsupported. ## Testing This is an integration test requiring a live DSQL cluster and IAM auth (`tests/integration/conftest.py` validates `CLUSTER_ENDPOINT` at import time), so it runs in CI via the `dsql-cluster-create` workflow rather than locally. Verified offline: - `pytest --collect-only tests/integration/test_aerich.py` → **26 tests collected**, including `test_aerich_add_column_migration[psycopg]` and `[asyncpg]`. Collection exercises the real import chain, including the DSQL backend registration. - `ruff check` → all checks passed; `ruff format --check` → already formatted. Please run the integration suite on this branch to confirm the downgrade passes against a real cluster. ## Related Part of the DSQL `DROP COLUMN` rollout: - Agent steering (canonical): [awslabs/agent-plugins#264](awslabs/agent-plugins#264) - Agent steering (mirror): [awslabs/mcp#4556](awslabs/mcp#4556) The adapters themselves already emit native `DROP COLUMN` as of #588 — this was the last spot in the repo still gated on the old limitation.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes
Summary
Mirrors awslabs/agent-plugins#264, the canonical home for DSQL agent steering. That PR was authored and reviewed first; this one carries the settled text.
Aurora DSQL shipped
ALTER TABLE ... DROP COLUMNon 2026-08-03, but this repo still asserted "DSQL does NOT support direct ...DROP COLUMN" and routed the operation through the destructive Table Recreation Pattern.DROP COLUMNis synchronous and metadata-only. UnlikeVALIDATE CONSTRAINTit has noALTER TABLE ASYNCform and returns nojob_id.Changes
Both agent-facing surfaces in this package are updated:
skills/dsql-skill/(source of truth) —SKILL.mdplusreferences/development-guide.md,references/ddl-migrations/{overview,column-operations}.md,references/mysql-migrations/{ddl-column-changes,type-mapping}.md.The five alias
SKILL.mdfiles were regenerated by thesync-dsql-skill-aliasespre-commit hook, not hand-edited — they differ from the source on thename:line only, and the hook is idempotent on a second pass.kiro_power/—POWER.mdplus the flattenedsteering/counterparts. Eachsteering/*.mdremains byte-identical to itsreferences/counterpart.CHANGELOG.md— entry under## Unreleased.Substance (identical to the canonical PR): the rule lands in the always-loaded
development-guide.md;column-operations.mddocuments the native statement with the rules that actually bite — PK key columns rejected with0A000,CASCADEonly for out-of-table dependents (a bare drop already sweeps the column's indexes and same-table constraints),CASCADEitself failing0A000when the dependency chain reaches a PK key column,IF EXISTS, gradual storage reclamation, and the 255-active / 1,600-lifetime column budget.The
Workflow 6sentence is now affirmative rather than "DSQL does NOT support direct ...", matching the canonical wording and the project's steering style.Table recreation is unchanged for
ALTER COLUMN TYPE,SET NOT NULL,DROP CONSTRAINT, andMODIFY PRIMARY KEY.User experience
Before — asked to drop an obsolete column, the agent produced a destructive multi-step migration: create a replacement table,
INSERT ... SELECTevery row (batched under 3,000), verify counts,DROP TABLE,RENAME, then rebuild indexes. On an 80k-row table that is minutes of work, a write outage, and an irreversibleDROP TABLE.After — the agent emits
ALTER TABLE orders DROP COLUMN legacy_promo_code, confirms the table and column with the user first, and addsCASCADEonly when a dependency actually requires it.Measured against the eval suite in
awslabs/agent-plugins(regex-graded, no cluster needed): 0/2 on the pre-change skill, 2/2 after.Checklist
Is this a breaking change? (Y/N) N
RFC issue number:
Checklist:
Testing notes
Documentation-only; the MCP server implementation is untouched. Verified:
skills/dsql-skill/passes skill structure/frontmatter validation;SKILL.md343 lines andPOWER.md259, both under the 500-line cap.diffper pair — note a recursivediff -ris not a valid check here, since subdirectory files are flattened intosteering/filenames).SKILL.mdfiles differ fromdsql-skill/SKILL.mdon exactly thename:line.Pre-existing issue noted but not fixed
The
steering/tree was flattened without rewriting intra-document relative links, so links like../ddl-migrations/column-operations.mdare already dead there (23 instances across the files this PR touches). This PR preserves the byte-identical mirror rather than diverging the two trees, so it neither fixes nor worsens the aggregate count. Happy to follow up with a dedicated link-rewrite pass if you'd prefer that separately.Acknowledgment
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the project license.