title: Room cannot verify the data integrity in Android
body: <blockquote>
    <p>MainActivity class</p>
  </blockquote>
  
  <pre><code>public class MainActivity extends BaseActivity {
  
      private AppDatabase db;
  
      @Override
      protected void onCreate(Bundle savedInstanceState) {
          super.onCreate(savedInstanceState);
          setContentView(R.layout.activity_main);
  
          // Database creation
          db = Room.databaseBuilder(getApplicationContext(),
                  AppDatabase.class, "Medimap-db").build();
  //        Profile profile=new Profile("rajitha","12-2-345","male","no 345","test med","test emergency","testurl");
  //        db.profileDao().insert(profile);
  //        Toast.makeText(getApplicationContext(),"success",Toast.LENGTH_SHORT).show();
          new DatabaseAsync().execute();
  
  
      }
  
      private class DatabaseAsync extends AsyncTask&lt;Void, Void, Void&gt; {
  
          @Override
          protected void onPreExecute() {
              super.onPreExecute();
  
              //Perform pre-adding operation here.
          }
  
          @Override
          protected Void doInBackground(Void... voids) {
              //Let's add some dummy data to the database.
              Profile profile = new Profile("rajitha", "12-2-345", "male", "no 345", "test med", "test emergency", "testurl");
              db.profileDao().insert(profile);
  
  
              return null;
          }
  
          @Override
          protected void onPostExecute(Void aVoid) {
              super.onPostExecute(aVoid);
              Toast.makeText(getApplicationContext(), "success", Toast.LENGTH_SHORT).show();
              //To after addition operation here.
          }
      }
  
  }
  </code></pre>
  
  <blockquote>
    <p>AppDatabase class</p>
  </blockquote>
  
  <pre><code>   @Database(entities = {Profile.class, Medicine.class}, version = 1)
      public abstract class AppDatabase extends RoomDatabase {
          public abstract ProfileDao profileDao();
          public abstract MedicineDao medicineDaoDao();
      }
  </code></pre>
  
  <blockquote>
    <p>ProfileDao</p>
  </blockquote>
  
  <pre><code>@Dao
  public interface ProfileDao {
  
      @Query("SELECT * FROM profile")
      List&lt;Profile&gt; getAll();
  
  //    @Query("SELECT * FROM user WHERE uid IN (:userIds)")
  //    List&lt;Profile&gt; loadAllByIds(int[] userIds);
  
  //    @Query("SELECT * FROM user WHERE first_name LIKE :first AND "
  //            + "last_name LIKE :last LIMIT 1")
  //    User findByName(String first, String last);
  
      @Insert
      void insertAll(Profile... profiles);
  
      @Insert
      void insert(Profile profile);
  
      @Delete
      void delete(Profile profile);
  }
  </code></pre>
  
  <blockquote>
    <p>Here I got an error after the first run of the app. It seems like the app is trying to create DATABASE once again, but there already is an existing one so they suggested to change the version code. My requirement is that I only need to insert a new data set. How can I achieve that? Thanks in advance. Here is the logcat error:</p>
  </blockquote>
  
  <pre><code>Caused by: java.lang.IllegalStateException: Room cannot verify the data integrity. Looks like you've changed schema but forgot to update the version number. You can simply fix this by increasing the version number.
  </code></pre>