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

No such table with migration #820

Open
welshrat77 opened this issue Oct 17, 2019 · 2 comments
Open

No such table with migration #820

welshrat77 opened this issue Oct 17, 2019 · 2 comments

Comments

@welshrat77
Copy link

Hi I am having major problems getting my app to upgrade.

I have a migration script 2.sql with the following

@welshrat77
Copy link
Author

welshrat77 commented Oct 17, 2019

ALTER TABLE APP_USER add EMERGENCY_PHONE TEXT;

UPDATE APP_USER SET LOGGED_IN = 0 ;

And I get the following error installing the update via google internal testing

Caused by android.database.sqlite.SQLiteException
no such table: APP_USER (code 1): , while compiling: ALTER TABLE APP_USER add EMERGENCY_PHONE TEXT

App is working fine with version 1 and also works fine if I do a fresh install however wont work with upgrade

@welshrat77
Copy link
Author

Ok so having done some reading it appears as though sugar now takes care of migrations however how can I set a database column (logged in) to 0 if the db is not yet upgraded.

i.e if they are on version 1 then log out otherwise leave it be.

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

No branches or pull requests

1 participant