title: SQLite PRIMARY key AutoIncrement doesn't work
body: <p>I'm trying to a have a table with an auto incremented primary key. The SQL query for table creation is included.<br>
  Problem is the auto-increment does not work. Meaning when I insert a row with NULL as the value of <code>conversation_id</code> it just inserts <code>null</code>. I have this problem on multiple tables.</p>
  
  <pre><code>-- Table: conversations
  CREATE TABLE conversations (
      conversation_id INTEGER (64) PRIMARY KEY
                                   UNIQUE,
      target_id       BIGINT (64),
      sender_id       BIGINT (64),
      status          STRING (16)  NOT NULL
                                   DEFAULT unseen,
      is_group        INTEGER (1)  NOT NULL
                                   DEFAULT (0),
      last_update     INTEGER (32) DEFAULT (0),
      target_name     STRING (64),
      target_photo    STRING (256),
      unread_count    INTEGER (10) DEFAULT (0),
      last_message    STRING (256) 
  );
  </code></pre>
  
  <p>The following is the method I use to insert into table:</p>
  
  <pre><code>public Conversation addConversation(Conversation conversation) {
          SQLiteDatabase db = getWritableDatabase();
          ContentValues row = new ContentValues();
  
          row.put("target_id", conversation.getTargetID());
          row.put("sender_id", conversation.getSenderID());
          row.put("target_name", conversation.getTargetName());
          row.put("target_photo", conversation.getTargetPhoto());
          row.put("status", conversation.getStatus());
          row.put("unread_count", conversation.getUnreadCount());
          row.put("last_message", conversation.getLastMessage());
  
          conversation.setConversationID(db.insert(TBL_CONVERSATIONS, null, row));
          Log.d(TAG, "conversation added: "+conversation.getConversationID());
  
          db.close();
  
          return conversation;
      }
  </code></pre>
  
  <p>The curious thing here is when I retrieve the insert id from <code>insert</code> method it returns the correct value, but the actual database field is null.</p>
  
  <p>If I understand correctly <code>A column declared INTEGER PRIMARY KEY will autoincrement.</code> <a href="https://www.sqlite.org/faq.html#q1" rel="nofollow">[Cite]</a></p>