Hacker News new | past | comments | ask | show | jobs | submit login

What's difficult about schema migration? Not being snarky, genuinely curious :)





> What's difficult about schema migration? Not being snarky, genuinely curious :)

SQLite's ALTER TABLE support isn't on par with other dbs. That's primarily (perhaps solely) because it stores table definitions as their raw SQL, rather than in some "idealized form." When SQLite first needs to understand a table's structure, it reads the original SQL which was used to create that table. Retroactively modifying arbitrary string input from the user (in this case SQL code) is a minefield.

Edit: see <https://www.sqlite.org/lang_altertable.html> in particular the final section, currently titled "Why ALTER TABLE is such a problem for SQLite"


Interesting, thanks for sharing! This sounds like a nightmare haha

What kinds of problems does this cause in practice? Do you have any examples? Not questioning you, just curious to learn more.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: