T TedDog Member Licensed User Longtime User Dec 25, 2013 #1 I plan on posting an update to my app that will include additional columns in my SQLite database, and possibly even a new table. What will happen to the existing database? Will it upgrade? Will data be lost?
I plan on posting an update to my app that will include additional columns in my SQLite database, and possibly even a new table. What will happen to the existing database? Will it upgrade? Will data be lost?
elitevenkat Active Member Licensed User Longtime User Dec 25, 2013 #2 It will not be automatic update!. You have to create a Sql script with alter / create command to accommodate the changes. Upvote 0
It will not be automatic update!. You have to create a Sql script with alter / create command to accommodate the changes.
T TedDog Member Licensed User Longtime User Dec 25, 2013 #3 elitevenkat said: It will not be automatic update!. You have to create a Sql script with alter / create command to accommodate the changes. Click to expand... Would it be possible for you to give me an example? Also, what would be a good way to test if the database hadn't yet been updated, and the script needed to be run. Upvote 0
elitevenkat said: It will not be automatic update!. You have to create a Sql script with alter / create command to accommodate the changes. Click to expand... Would it be possible for you to give me an example? Also, what would be a good way to test if the database hadn't yet been updated, and the script needed to be run.
D Dman Active Member Licensed User Longtime User Dec 26, 2013 #4 Check and add a new table: Code: Copy If SQL1.ExecQuerySingleResult("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='yourtablename'") = 0 Then SQL1.ExecNonQuery("CREATE TABLE yourtablename(field1 TEXT, field2 TEXT)") End If Adding a column, I'd have to study and experiment on that one. Hope it helps. Upvote 0
Check and add a new table: Code: Copy If SQL1.ExecQuerySingleResult("SELECT count(name) FROM sqlite_master WHERE type='table' AND name='yourtablename'") = 0 Then SQL1.ExecNonQuery("CREATE TABLE yourtablename(field1 TEXT, field2 TEXT)") End If Adding a column, I'd have to study and experiment on that one. Hope it helps.