Sqlite db init and migrations #74
-
Hello @benbjohnson I had a few questions regarding how you initialized your sqlite database and handle migrations. Regarding the I would also like to verify with you that I've got the correct idea about how the migrations are being performed. It seems like you create a table called Would you consider this as sufficient for large projects as well? I've been searching for db migrations (particularly in sqlite) for go and it's incredibly difficult to find anything that doesn't use PS, what is your opinion regarding using Best regards |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
Yes, I just manually write the SQL to do migrations. I would just add a new
Yep. That's correct. You also need to make sure you're executing the migrations in sorted order. One thing I would change is that I would use the https://www.sqlite.org/pragma.html#pragma_user_version
It depends. You need to coordinate a little bit to make sure you don't have different people trying to edit the same version number. Another option that I think Rails does is to name the file based on a timestamp and track that in the
I haven't used it but I generally don't like having additional tooling for migrations. I think migrations should be straightforward. I also don't do reverse migrations as I find them brittle. |
Beta Was this translation helpful? Give feedback.
Yes, I just manually write the SQL to do migrations. I would just add a new
.sql
file with the next sequence number.