Skip to content

Sqlite Migrations: Table rebuilds #329

Closed

Description

@bricelam

In SQLite, the following operations will require rebuilding the table - https://docs.microsoft.com/en-us/ef/core/providers/sqlite/limitations.

Other databases also have a smaller set of limitations that require a table rebuild (i.e. changing Identity on a column in SQL Server).

Activity

  1. ErikEJ commented on Jun 18, 2014

    @ErikEJ
    Contributor

    Yes, great RDBMS

  2. ghost removed this from the milestone on Aug 20, 2014
  3. ghost added this to the milestone on Aug 20, 2014
  4. Repository owner unassigned on Sep 12, 2014
  5. bricelam commented on Jun 18, 2015

    @bricelam
    ContributorAuthor

    Re-opening. I've "regressed" this. (not sure if it ever actually worked since there weren't any tests)

  6. removed this from the milestone on Jun 18, 2015
  7. added this to the 7.0.0 milestone on Jun 26, 2015
  8. 134 remaining items

  9. Damus765 commented on Apr 30, 2020

    @Damus765

    @danielmeza I would say we need to create every constraint in the "temp table". Because what you call "temp table" is not really temporary. It is in fact the new table that will be kept once renamed. So I'm not sure CREATE TABLE AS is the best way to create the new table.

  10. danielmeza commented on Apr 30, 2020

    @danielmeza

    @Damus765 I was missing the rename process, I thought that the data will be copy to the new table so the process goes like this. Create the temp table -> delete the old table -> create the new table with the new schema -> copy data back from the temp table -> delete the temp table.

  11. Damus765 commented on Apr 30, 2020

    @Damus765

    @danielmeza According to the SQLite documentation, the recommended steps are as follows:

    1. Create new table
    2. Copy data from old table into new table
    3. Drop old table
    4. Rename new into old

    Only one data copy is required and you don't need a temp table.

  12. bricelam commented on Apr 30, 2020

    @bricelam
    ContributorAuthor

    @danielmeza Our strategy for using migrations with existing databases is tracked by #2167

  13. bricelam commented on May 29, 2020

    @bricelam
    ContributorAuthor

    More related issues for SQL Server: #12586, #16758, #18965 & #20943

  14. modified the milestones: 5.0.0, on Jul 16, 2020
  15. bricelam commented on Jul 16, 2020

    @bricelam
    ContributorAuthor

    it's been 84 years...

    But seriously, my six-year-old wasn't even born when I filed this issue. Crazy.

    May all your rebuilding dreams come true! Check out our daily builds if you're eager to give it a try. Let me know if you find any bugs. (I still have a bit more testing to do myself.)

  16. modified the milestones: , 5.0.0 on Nov 7, 2020
  17. added theissue type on Jun 15, 2025
  18. marked support migration for sqlite #14200 as a duplicate of this issue on Jun 16, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions