Skip to content

How is the schema version identified? #187

Answered by czocher
danielniccoli asked this question in Q&A
Discussion options

You must be logged in to vote

Hello @danielniccoli,
As mentioned in the README.md file:

Fast database opening: to keep track of the current migration state, most tools create one or more tables in the database. These tables require parsing by SQLite and are queried with SQL statements. This library uses the user_version value instead. It’s much lighter as it is just an integer at a fixed offset in the SQLite file.

In layman terms it means we use the user_version field to store a counter of how many migrations (in the order you provide them in) have already been applied. If you add a new migration and apply it, this counter is also incremented to indicate that.

This has the benefit of being extremely simple, but one …

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by danielniccoli
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants