0

I am working on a iOS mobile application using Xcode as the IDE and Swift as the language of choice. I added a column to the SQLite database that interacts with my application but unfortunately when I attempt to perform any database operations through the application the column is not recognized.

The following error is sent:

DB Error: 1 "table xyz has no column named column_name"

When I added the column I also increased the database version or user_version in SQLiteStudio.

Is there something else I should be doing to cause the application to recognize the changes? I know uninstalling and reinstalling would work but that is not an option of course as I cannot lose the data currently housed in the database. My other idea was to put all the data in temporary variables or something like that, drop and recreate the tables and reinsert the data. I wasn't sure if this was a good course of action though. Any help with this is appreciated.

Deus Ex Machina
  • 383
  • 2
  • 5
  • 18
  • Did you commit column addition? There is a green button at table windows's toolbar for that. It becomes active whenever there are any changes pending for commit. – Googie Jul 20 '19 at 08:10
  • Yes I did commit the column addition. The changes do appear to be active from the SQLiteStudio perspective, but when I attempt to do any db operations using that column via XCode the error is thrown. – Deus Ex Machina Jul 22 '19 at 17:02
  • I'm not sure how this works in Xcode/iOS, but perhaps you need to upload/deploy your updated database into the target iOS. At least this is how this works with Android and for Android there is a plugin for SQLiteStudio which solves this problem by connecting directly to a database that is already there on the device. – Googie Jul 23 '19 at 18:21

0 Answers0