title: How to make a case-insensitive unique column in SQLite
body: <p>I haven't been able to find the answer to this. I'm trying to create a table with a unique email address column. And when I do</p>
  
  <pre><code>CREATE TABLE users (
    email TEXT PRIMARY KEY,
    password TEXT NOT NULL CHECK(password&lt;&gt;''),
    UNIQUE (lower(email))
  )
  </code></pre>
  
  <p>when using PDO, I get the error:</p>
  
  <blockquote>
    <p>Fatal error: Uncaught exception 'PDOException' with message 'SQLSTATE[HY000]: General error: 1 near "(": syntax error' in script.php:65 Stack trace: #0 script.php(65): PDO->exec('CREATE TABLE us...') #1 {main} thrown in script.php on line 65</p>
  </blockquote>
  
  <p>Line 65 is the <code>CREATE TABLE</code> line.  If I take out the <code>UNIQUE</code>, it works fine. Is there a better way of doing it? </p>