title: Why does my SQLite database get deleted when it's changed?
body: <p>I'm trying to implement version control into my database. I have following code:</p>
  
  <pre><code>if (File.Exists (dbPath)) {
      database = new SQLiteConnection(dbPath);
      dbVersion = GetDatabaseVersion();
      if (dbVersion != DATABASE_VERSION) {
          CreateDatabase(dbPath);
          database = new SQLiteConnection(dbPath);
          SetDatabaseVersion(DATABASE_VERSION);
      }
  } else {
          CreateDatabase(dbPath);
          database = new SQLiteConnection(dbPath);
          SetDatabaseVersion(DATABASE_VERSION);
  }
  </code></pre>
  
  <p>When I run the code for the first time <code>File.Exists (dbPath)</code> returns false as expected. When I then stop the app and build and deploy again, <code>File.Exists (dbPath)</code> returns true (as expected) and the versions get checked. But when I change an entry in the database (not the version) and I build and deploy again <code>File.Exists (dbPath)</code> returns false. So I guess the sqlite-file gets deleted when it's changed?</p>
  
  <p>What I want to achieve is that when the sqlite-file is changed, but the version numbers are still the same, the database of the app isn't updated. Only when the versions don't match, it has to be updated.</p>
  
  <p>(It works perfectly for iOS this way, by the way)</p>
  
  <p>Can anyone help me?</p>
  
  <p>Thanks in advance.</p>