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

DB Recreation Error #23

Open
tonespy opened this issue Sep 10, 2015 · 3 comments
Open

DB Recreation Error #23

tonespy opened this issue Sep 10, 2015 · 3 comments

Comments

@tonespy
Copy link

tonespy commented Sep 10, 2015

I noticed something. If I drop a Table when I implement Logout in my app and come back in, the data is stored, but it can't be accessible unless I quit the app and then open it again. Do you know what might be the cause. I tried to log that the data is being stored and I noticed it's. But, then why isn't getting accessible on first try?

@bhurling
Copy link
Contributor

Hi, you're right. This is currently not supported. Some background: The tables are created in the AbstractProvider's onCreate()-method which is called by the framework during app startup. In there we create a subclass of SQLiteOpenHelper that does all the magic. Unfortunately, we don't hold a reference to that helper so we cannot recreate the schema while the app is running.

For now, you may want to just purge the data but not the schema when your users log out.

If this is something that affects more users, I might come up with a better architecture, where things like that are supported.

@artkoenig
Copy link

I would like to have this feature too. Background: I would like to do a migration by dropping all the data an recreating it with a new structure without an app restart.

@bhurling
Copy link
Contributor

bhurling commented Jan 5, 2016

@artkoenig Can you explain why you want to migrate the db schema at runtime?

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

3 participants