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

Migration? #2

Open
riccione opened this issue Jul 27, 2018 · 2 comments
Open

Migration? #2

riccione opened this issue Jul 27, 2018 · 2 comments

Comments

@riccione
Copy link

riccione commented Jul 27, 2018

Hi.

I was trying to update the database. I did this by increasing the number of version inside AppDatabase. In this case I got an error that I must setup migrations. I tried to do it in this way

Room.databaseBuilder(context.getApplicationContext(),
AppDatabase.class, "database.db")
.fallbackToDestructiveMigration()
.openHelperFactory(new AssetSQLiteOpenHelperFactory())
.build();

And in result I get an empty database?! How can I solve this? Where is my mistake?

@riccione
Copy link
Author

Actually I got it. There is not important to provide any migration. But how to pass to the AssetSQLiteOpenHelperFactory information that the database was updated inside the asset folder?

@Pheromone89
Copy link

teOpenHelperFac

How to do that? I'm stuck in the same problem.

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

2 participants