Skip to content

Add support for PRAGMA legacy_alter_table #481

@kpts44

Description

@kpts44

I heavily rely on "ALTER TABLE ... RENAME TO ..." for migrations between database versions in my application. Since upgrading SQLite, this also renames the FOREIGN KEY linking to the renamed table, which is something I really do not want as this is a migration, and the original table (with the original table name) is going to be recreated.

This behavior is documented here: https://www.sqlite.org/lang_altertable.html

In order to retain the legacy behavior where foreign keys are not renamed, I need to use PRAGMA legacy_alter_table which is not in the list of accepted pragmas. For now, I added it and recompiled, but I think this pragma deserves to be in the list :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement:SQLiteEnhancement about sqlite featuresgood first issueGood first issue for new contributorsreleasedIssue has been released

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions