title: SQLite only creates 2 tables
body: <p>Because of some reason SQLite only creates two tables instead of 4. I'm using this code:</p>
  
  <pre><code>@Override
  public void onCreate(SQLiteDatabase db) 
  {
      String TABLE_RECEIPT            = "CREATE TABLE RECEIPT (receiptId INTEGER PRIMARY KEY AUTOINCREMENT, receiptDate INTEGER); ";
      db.execSQL(TABLE_RECEIPT);
  
      String TABLE_PRODUCT            = "CREATE TABLE PRODUCT (productId INTEGER PRIMARY KEY AUTOINCREMENT, productName TEXT NOT NULL, productImagePath TEXT, productPrice REAL NOT NULL);";
      db.execSQL(TABLE_PRODUCT);
  
      String TABLE_RECEIPT_RULE       = "CREATE TABLE RECEIPT_RULE (receiptId INTEGER NOT NULL, productId INTEGER NOT NULL, ruleAmount INTEGER NOT NULL, PRIMARY KEY (receiptId, productId), FOREIGN KEY(receiptId) REFERENCES RECEIPT(receiptId), FOREIGN KEY(productId) REFERENCES PRODUCT(productId));";
      db.execSQL(TABLE_RECEIPT_RULE);
  
      String TABLE_PRODUCT_ATTRIBUTES = "CREATE TABLE PRODUCT_ATTRIBUTES (productId INTEGER NOT NULL, attributeName TEXT NOT NULL, attributeValue TEXT NOT NULL, PRIMARY KEY (productId, attributeName), FOREIGN KEY(productId) REFERENCES PRODUCT(productId));";
      db.execSQL(TABLE_PRODUCT_ATTRIBUTES);
  
      Log.i(Config.TAG, "Recreated database");
  }
  
  @Override
  public void onUpgrade(SQLiteDatabase db, int oldVersion, int newVersion) 
  {
      String TABLE_PRODUCT            = "DROP TABLE PRODUCT;";
      String TABLE_RECEIPT            = "DROP TABLE RECEIPT;";
      String TABLE_RECEIPT_RULE       = "DROP TABLE RECEIPT_RULE;";
      String TABLE_PRODUCT_ATTRIBUTES = "DROP TABLE PRODUCT_ATTRIBUTES;";
  
      db.execSQL(TABLE_PRODUCT);
      db.execSQL(TABLE_RECEIPT);
      db.execSQL(TABLE_RECEIPT_RULE);
      db.execSQL(TABLE_PRODUCT_ATTRIBUTES);
      onCreate(db);
  }
  </code></pre>
  
  <p>The message <code>Recreated database</code> is visible, so it does try to create all tables. It doesn't show any kind of error. </p>
  
  <p>I don't know if it's usefull, but i'm reading the existing tables with the code below:</p>
  
  <pre><code>//Placed in SQLiteStorage
  public Cursor showAllTables(){
      String mySql = " SELECT name FROM sqlite_master " + " WHERE type='table'             "
              + "   AND name LIKE 'PR_%' ";
      return db.rawQuery(mySql, null);
  }   
  
  //In Activity, create the storage and calls the function 
  Cursor c = new SQLiteStorage(this).showAllTables();
  if (c.moveToFirst()) 
  {
      while(!c.isAfterLast())
      {
          Log.i(Config.TAG, c.getString(0));
          c.moveToNext();
      }
  }
  </code></pre>