Custom App breaks when it's moved or duplicated and moved to another space

It’s such a breeze to be able to move dbs between spaces. Unfortunately, with custom apps it’s not like this since db mapping doesn’t change and requires code debugging afterwards. Would it be possible for you to ensure that the db mapping changes automatically in the custom app code?