Change SQLite Database Version Number

后端 未结 3 854
日久生厌
日久生厌 2020-12-14 06:35

I have a database that I built in SQLite browser, and it works fine. I launched an app with a prebuilt database and now I want to add more tables and data to that database.

相关标签:
3条回答
  • 2020-12-14 07:10

    To manually update the version to 4 you execute the following SQL statement:

    PRAGMA user_version = 4
    
    0 讨论(0)
  • 2020-12-14 07:10

    You can also set it via the setVersion SqlLiteDatabase method.

    Source: http://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#setVersion(int)

    0 讨论(0)
  • 2020-12-14 07:21

    Another way to change the version of your Sqlite Database. You can use DB Browser for SQLite:

    1. Open the database file with "DB Browser for SQLite".
    2. Change the "User Version" number to whatever number you want
    3. Click the "Save" button Sqlite Database Browser
    0 讨论(0)
提交回复
热议问题