I have a small application for android written in java, I am rewriting using flutter.
Is it possible to transition to the new version by keeping the SQLite database structure intact, including all data?
I ran a test, and although I was able to overwrite the application, the data was lost after upgrade.
If anyone needed it, I was able to read the data from the existing database and write to it using flutter.
My previous test had gone wrong because the bases were allocated in separate directories.
In java, I had created the database using the SQLiteOpenHelper
class, while in the new flutter application I tried to connect using getApplicationDocumentsDirectory()
.
I just changed the access path, and it's all settled :)
var databasesPath = await getDatabasesPath ();
String path = join (databasesPath, "database.db");
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With