magicalpanda / MagicalRecord

Super Awesome Easy Fetching for Core Data!
Other
10.8k stars 1.79k forks source link

Rename of target leads to creating new persistent store #1273

Open Antowkos opened 7 years ago

Antowkos commented 7 years ago

Details: I renamed my target which was set up core data stack with method setupCoreDataStackWithAutoMigratingSqliteStoreNamed: and after that i was informed that all users were "lost" their data. After quick investigation i found out that MR creates data base at path Application Support/{name_of_target}/. So I had to make merge and be sure that all users will be able to "return" their data back. Well, this is REALLY bad solution for that feature. Why did you choose that way? There are much better solutions like using bundle identifier. Of course it can be changed too, but this case is much rare then renaming of target. Or you can save it in the root of 'Application Support' folder. Or at least you can provide docs to your methods in Xcode with warning and explanation of how your methods is working.

TripwireNL commented 7 years ago

Had this problem as well. Really annoying and cost me like 2 hours to figure out what was going wrong! Please fix this in the future!!