title: Wrong (old) columns when creating new tables
body: <p>I'm writing an simple app in Xcode.
  There is a problem I can't solve:</p>
  
  <p>When I want to create a new table with sqlite3 I use:
  <code>create table if not exists %@(some values...)</code></p>
  
  <p>the table is created just fine, but it is not creating the correct columns.
  Instead, it keeps some old columns.</p>
  
  <p>Tried to drop all tables and even deleted the sqlite3 file and reinstalled it...nothing works.</p>
  
  <p>Is there any solutions?</p>
  
  <p>Thank you!</p>
  
  <p>EDITED:</p>
  
  <p>Here is my code:</p>
  
  <p>It seems like all the tables created correctly, but the columns inside the last table dont reflect its content from the query "create table..." above.</p>
  
  <p>When I start my app I use drop table to clear all tables...</p>
  
  <p>I created the sqlite3 file and added it to the project in Xcode.
  I'm checking my app on a simulator and on a real iPhone device.
  Tried to delete the app from the device but the problem remains when simulating again on the device.
  I deleted the sqlite3 file and create a new one, added it to Xcode, but it still uses the old table columns... </p>
  
  <p>After using ALTER TABLE, the table is updated with the new column, but when dropping it and create again, the old values appears again...</p>
  
  <p>have no idea how to continue :\            </p>
  
  <pre><code>        query = [NSString stringWithFormat:@"create table if not exists %@(medID integer primary key, name text, start text, days integer, timesPerDay integer, complete text)",[self.nameText.text stringByAppendingString:@"Medications"]];
  
          [self.dbManager executeQuery:query];
          if(self.dbManager.affectedRows != 0){
              NSLog(@"4 Query was executed successfully. Affected rows = %d", self.dbManager.affectedRows);
          }
          else{
              NSLog(@"Could not execute the query.");
          }
  
          //add vet table for pet
  
          query = [NSString stringWithFormat:@"create table if not exists %@(vetID integer primary key, name text, start text, days integer, timesPerDay integer, complete text)",[self.nameText.text stringByAppendingString:@"Veterinary"]];
  
          [self.dbManager executeQuery:query];
          if(self.dbManager.affectedRows != 0){
              NSLog(@"5 Query was executed successfully. Affected rows = %d", self.dbManager.affectedRows);
          }
          else{
              NSLog(@"Could not execute the query.");
          }
  
          query = @"SELECT name FROM sqlite_master WHERE type = 'table'";
          NSLog(@"%@",[self.dbManager loadDataFromDB:query]);
  
  
          query = @"pragma table_info(biVeterinary)";
          NSLog(@"%@",[self.dbManager loadDataFromDB:query]);
  
  
          query = @"alter table biVeterinary add column A text;";
          [self.dbManager executeQuery:query];
  
          query = @"pragma table_info(biVeterinary)";
          NSLog(@"%@",[self.dbManager loadDataFromDB:query]);
  </code></pre>
  
  <p>and here is what I get in the console:</p>
  
  <p>2014-10-25 11:03:39.998 iPet2[771:14838] 1 Query was executed successfully. Affected rows = 1</p>
  
  <p>2014-10-25 11:03:40.000 iPet2[771:14838] 2 Query was executed successfully. Affected rows = 1</p>
  
  <p>2014-10-25 11:03:40.002 iPet2[771:14838] 3 Query was executed successfully. Affected rows = 1</p>
  
  <p>2014-10-25 11:03:40.003 iPet2[771:14838] 4 Query was executed successfully. Affected rows = 1</p>
  
  <p>2014-10-25 11:03:40.004 iPet2[771:14838] 5 Query was executed successfully. Affected rows = 1</p>
  
  <p>2014-10-25 11:03:40.005 iPet2[771:14838] (
          (
          pets
      ),
          (
          biVeterinary
      ),
          (
          biVaccinations
      ),
          (
          biMedications
      )
  )</p>
  
  <p>2014-10-25 11:03:40.006 iPet2[771:14838] (
          (
          0,
          vetID,
          integer,
          0,
          1
      ),
          (
          1,
          visitDate,
          text,
          0,
          0
      ),
          (
          2,
          problem,
          text,
          0,
          0
      )
  )</p>
  
  <p>2014-10-25 11:03:40.008 iPet2[771:14838] (
          (
          0,
          vetID,
          integer,
          0,
          1
      ),
          (
          1,
          visitDate,
          text,
          0,
          0
      ),
          (
          2,
          problem,
          text,
          0,
          0
      ),
          (
          3,
          A,
          text,
          0,
          0
      )
  )</p>
  
  <p>THANKS!!!</p>