Conversation
…OLUMN Co-authored-by: jogibear9988 <364896+jogibear9988@users.noreply.github.com>
|
@copilot and what about DropColumn? is this not also natively supported? |
|
@copilot and droptable and dd column? seems all to be now supprted. |
Yes, SQLite 3.35.0+ added native Native DROP COLUMN cannot drop:
Current RecreateTable provides:
The existing tests expect these behaviors (e.g., dropping PK columns, auto-removing FKs). Switching to native DROP COLUMN would require either:
For now, I kept RecreateTable for DROP COLUMN to maintain compatibility. RenameColumn was straightforward since SQLite's native command handles all references automatically. |
You're right! Looking at the code:
Native ADD COLUMN has been in SQLite since 3.1.3 (2005) with only minor limitations (can't add PK/UNIQUE columns). The current tests add simple nullable columns, which work fine with native support. I'll update AddColumn to use the native command. |
…support Co-authored-by: jogibear9988 <364896+jogibear9988@users.noreply.github.com>
SQLite 3.25.0+ supports
ALTER TABLE ... RENAME COLUMNnatively. The codebase was using a workaround that recreated the entire table.Changes
Removed SQLiteTransformationProvider.RenameColumn override (82 lines)
ALTER TABLE table RENAME COLUMN old TO newRemoveColumn unchanged
DROP COLUMN(3.35.0+) cannot drop PRIMARY KEY, UNIQUE, or foreign key-referenced columnsAddColumn unchanged
ADD COLUMN(3.1.3+) cannot add PRIMARY KEY or UNIQUE columnsRemoveTable (DropTable) - No changes needed
DROP TABLEcommand (no SQLite override exists)Example
All 134 SQLite tests pass.
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.