-
Notifications
You must be signed in to change notification settings - Fork 247
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
Allow sqlite migrations for non-default databases. #2610
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Given we have docs that use examples like spin up --sqlite @migrations.sql
, and that migrations may come as a sequence of files (a la migrations001.sql
, migrations002.sql
, etc.), I'm reluctant to adopt this UI. Let's instead look for a more structured and specific syntax, such as --sqlite custom-db:@migrations.sql
or --sqlite @migrations.sql>custom-db
(the latter would presumably make shells mad but just trying to spark ideas).
@itowlson thanks for raising these concerns. I personally don't have strong feeling about what the right UX is here. I'd just want to ensure that it's easy to tell when the user is passing a file vs when they're passing raw SQL (since we support both). Right now the |
|
@itowlson ok done! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple of non-blocking suggestions, but before merging could you double check that the indents around lines 76-78 are right in the real code? I'm assuming a GH artifact but good to be sure! Otherwise LGTM - thanks!
The database will be selected by the name of the migration file. This makes the name of the migration file significant, whereas previously it was not. If the name of the file and a known database don't line up, `spin up` will fail with an error message. Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
Signed-off-by: Ryan Levick <ryan.levick@fermyon.com>
a644710
to
096904e
Compare
Fixes #2607
The database will be selected by the name of the migration file. This makes the name of the migration file significant, whereas previously it was not. If the name of the file and a known database don't line up,
spin up
will fail with an error message.