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

Upgrade doesn't work if there are more than 1 lines in the script #62

Open
QuickBrownFoxy opened this issue Jan 20, 2014 · 6 comments
Open
Assignees
Milestone

Comments

@QuickBrownFoxy
Copy link

For example
in

alter table RECORDING_FILE add ORIGINAL_SAMPLERATE TEXT;
alter table RECORDING_FILE add ORIGINAL_BITRATE TEXT;

only the first line executed. Sugar seems to proccess it file but on db.execSQL(text.toString()); in SugarDB.java only first column added

@whoshuu whoshuu self-assigned this Jul 4, 2014
@whoshuu
Copy link
Collaborator

whoshuu commented Jul 29, 2014

Have you tried putting both columns into one line? I'll test this out myself some time tomorrow and get back to you.

@doublerebel
Copy link

Spent a good hour today hunting this one down. I could not get multiple commands to execute whether on two lines or one. However, adding both 2.sql and 3.sql with one line each, and bumping the version to 3 in the manifest, executed the upgrade.

@whoshuu whoshuu added the closing label Apr 1, 2015
@whoshuu
Copy link
Collaborator

whoshuu commented Apr 1, 2015

Migration troubles are a frequent area of concern. I'm glad you were able to get your migrations to work. In the future I hope we can get some work done on that part of the codebase to make procedures like this much easier.

@whoshuu whoshuu closed this as completed Apr 4, 2015
@doublerebel
Copy link

Hello,

As this is a major issue with migrations, I don't believe the issue should be closed. At the minimum the documentation (http://satyan.github.io/sugar/migration.html) should be updated to reflect the actual behavior of the current code. Unless this has been fixed?

@whoshuu
Copy link
Collaborator

whoshuu commented Apr 8, 2015

Hey @doublerebel, thanks for bringing this up again. In my haste I closed this issue because 1.5.0 is the release we're planning on overhauling the migration system. You make a good point, it's important to keep this issue around to make sure we don't repeat the mistake of only allowing for one sql statement per migration file. Reopening this and tagging it appropriately.

@whoshuu whoshuu reopened this Apr 8, 2015
@whoshuu whoshuu added this to the 1.5.0 milestone Apr 8, 2015
@doublerebel
Copy link

thanks 😃

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

No branches or pull requests

3 participants