Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Config migration table name #12

Closed

Conversation

boblauer
Copy link
Contributor

I took a swing at this, appears to be working well. I kept the 0.sql file because there are a lot of assumptions in the code that the file name index will match the index of that file's entry in the migrations table, and without that 1.sql would be in the 0th index, for example. It feels slightly hacky, but I think it prevents the code from getting unnecessarily complex enough that it's worth the tradeoff.

Closes #4

…o inline

Later on, it'll be easier to swap in the custom migrations table name
Much of the code assumes the index of the script in the file system matches the index of the script entry in the database. If we don't keep a 0th index file, that assumption is no longer true.
@boblauer
Copy link
Contributor Author

Hhmm, thinking more about this this might cause issues. The problem (I think) is that if anyone uses this new functionality but has already run an existing migration, the first entry in the migrations table is going to fail the hash check, because the 0.sql file now has a different hash.

We could always bypass a hash check for the 0th file, since that one is part of this codebase and we know it's ok that it changed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant