title: Updating SQLite Database and prevent to reset all database
body: <p>I've got an SQLite database. I would like to update this database to version 2.0. But the main key of my app is that some parts of data from database version 1.0 are modified by users and I don't want the situation that version 2.0 erase this data. What I want is to add some rows to database and prevent reset all databases. How can I do it?</p>
  <pre><code>public static final String DBNAME = &quot;Animals.db&quot;;
  
  @SuppressLint(&quot;SdCardPath&quot;)
  
  public static final String DBLOCATION = &quot;/data/data/com.erk.animals/databases/&quot;;
  private Context mContext;
  private SQLiteDatabase mDatabase;
  
  
  
  
  
  public DatabaseHelper(Context context) {
  
      super(context, DBNAME, null, 1);
      this.mContext = context;
  }
  
  
  @Override
  public void onCreate(SQLiteDatabase db) {
  
  
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) {
  
  }
  
  
  public void openDatabase() {
  
      String dbPath = mContext.getDatabasePath(DBNAME).getPath();
      if (mDatabase != null &amp;&amp; mDatabase.isOpen()) {
          return;
      }
      mDatabase = SQLiteDatabase.openDatabase(dbPath, null, SQLiteDatabase.OPEN_READWRITE);
  }
  
  public void closeDatabase() {
  
      if (mDatabase != null) {
          mDatabase.close();
      }
  
  }
  </code></pre>