Sqlit Database Upgrade When Android app version is upgraded

Source: Internet
Author: User

When the application version upgrade to do some sqlit operation, such as adding a field, then the version upgrade after the Sqlit does not update will inevitably error

Then Sqlit provides the alert Table command, which allows the user to rename or add fields to the table

Specific solutions (take the table to add fields as an example):

1. Change table name A to temporary table temp_a: 
  
2. Create a new table A with the same original indication (the field in the new table has been incremented) 
  
3. Imports data from temp_a into a new table a" "to supplement a previously nonexistent field 
  
4. Delete temp_a table 
  
Reference: <a target=_blank href= "http://87426628.blog.163.com/blog/static/6069361820131069485844/" >http:// 87426628.blog.163.com/blog/static/6069361820131069485844/</a>

Sqlit Database Upgrade When Android app version is upgraded

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.