title: Why am I able to insert a duplicated value into a unique column
body: <p>So I want the user to be able to update my table. Besides the default <code>_ID</code> column, I also have a <code>NAME</code> column, which I declared unique and is the identifier I use for the rows.</p>
  
  <p>Now, for testing purposes, I am inserting the same values into the table. For some reason I find the table has duplicated its rows when using the <code>insert(String table, String nullColumnHack, ContentValues values)</code> method.</p>
  
  <p>But when I use <code>insertWithOnConflict(String table, String nullColumnHack, ContentValues initialValues, int conflictAlgorithm)</code> (where <code>int conflictAlgorithm</code> is <code>SQLiteDatabase.CONFLICT_IGNORE</code>) this doesn't happen.</p>
  
  <p>Basically, this is the translation of how I create my table:
  </p>
  
  <pre><code>"CREATE TABLE " + TABLE_NAME + " (" +
              _ID + " INTEGER PRIMARY KEY," +
              COLUMN_NAME_NAME + " TEXT NOT NULL ON CONFLICT REPLACE, " + 
              COLUMN_NAME_STATS + " TEXT," +
              COLUMN_NAME_ABILITIES + " TEXT," +
              COLUMN_NAME_PICTURE + " TEXT," +
              " UNIQUE(" + COLUMN_NAME_NAME + ")" + "ON CONFLICT REPLACE" +
              ")";
  </code></pre>
  
  <p>I also tried above without the <code>UNIQUE()...</code> clause at the end of the statement, but with a <code>COLUMN_NAME_NAME + " TEXT UNIQUE ON CONFLICT REPLACE , " +</code> declaration.</p>
  
  <p>To simplify, this is what I insert (I only insert names):
  </p>
  
  <pre><code>ContentValues cv;
  SQLiteDatabase db = dbHelper.getWritableDatabase();
  for(String t : someListOfStrings)
     cv.put(MyDBContract.MyDatabase.COLUMN_NAME_NAME,t);  //Where t from {"abc","def","ghi"}
  db.insert(MyDBContract.MyDatabase.TABLE_NAME, null, cv);
  </code></pre>
  
  <p>I'm populating my output via <code>"select * from " + MyDBContract.MyDatabase.TABLE_NAME</code>, which in this case are only 2 columns <code>ID</code> and <code>NAME</code></p>
  
  <p>And this is what I get:
  </p>
  
  <pre><code>_id: 1, name: abc
  _id: 2, name: def
  _id: 3, name: ghi
  _id: 4, name: abc
  _id: 5, name: def
  _id: 6, name: ghi
  </code></pre>
  
  <p>With <code>insertWithOnConflict</code> and <code>SQLiteDatabase.CONFLICT_IGNORE</code> constraint, only what I intended in the first place:</p>
  
  <pre class="lang-java prettyprint-override"><code>_id: 1, name: abc
  _id: 2, name: def
  _id: 3, name: ghi
  </code></pre>
  
  <p>Did I create the table wrong or why doesn't this work with the standard insert method? How do I create my table correctly? Or am I forced to work with <code>insertWithOnConflict</code>?</p>