simonalveteg / Workout-Tracker

A Workout Tracker for Android written with Jetpack Compose using MVVM architecture, a room database and dependency injection with dagger hilt.
21 stars 1 forks source link

Improve database import #50

Open simonalveteg opened 11 months ago

simonalveteg commented 11 months ago

If a row has been removed from one of the tables all of the relations will be wrong, since the primary key gets incremented for each added entity. Removing no32 would mean that 33->32 in that table, while all other tables are unaware of this change.

Inserting entity returns it's key, use this key to update references to the old key in other tables where applicable.