title: Android Room: One database with multiple tables
body: <p>I have two separate tables for my application, one is called users and the other is called passwords. </p>
  
  <p>Users:</p>
  
  <pre><code>@Entity(tableName = "users")
  public class Users {
     // some setters and getters here
  }
  </code></pre>
  
  <p>Passwords:</p>
  
  <pre><code>@Entity(tableName = "passwords")
  public class Passwords {
     // some setters and getters here
  }
  </code></pre>
  
  <p>And this is how I'm accessing the database:</p>
  
  <pre><code>usersdb = Room.databaseBuilder(this, Users.class,"mymaindb")
            .allowMainThreadQueries()
            .build();
  
  // Then later in some other activity when I need to use passwords table
  
  passwords = Room.databaseBuilder(this, passwords.class,"mymaindb")
            .allowMainThreadQueries()
            .build();
  </code></pre>
  
  <p>The issue I'm having is that after a fresh install, when I access passwords then I can't access users or vice versa.</p>
  
  <p>I get the following error:</p>
  
  <blockquote>
    <p>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.</p>
  </blockquote>
  
  <p>But when I try to have two separate databases like passwords_db and users_db instead of mymaindb, then it works completely fine.</p>
  
  <p>So is there a way I can have multiple tables under one database? If so, what am I doing wrong then? Thanks in advance!</p>