title: sqlite3.OperationalError: near "create": syntax error
body: <p>I'm getting a rather strange syntax error in my <code>schema.sql</code> file.</p>
  
  <p>The error is as follows:</p>
  
  <blockquote>
    <p>File "/Users/user/Documents/GitProjects/FlaskApp/flaskr/db.py", line
    88, in init_db_command
        init_db() File "/Users/user/Documents/GitProjects/FlaskApp/flaskr/db.py", line 80, in
    init_db
        db.executescript(f.read().decode("utf-8")) sqlite3.OperationalError: near "create": syntax error</p>
  </blockquote>
  
  <p>My schema looks like this:</p>
  
  <pre><code>drop table if exists post;
  drop table if exists post_user;
  
  create table post_user (
      user_id integer primary key autoincrement,
      email text unique not null,
      username text unique not null,
      password text not null
  );
  
  create table post (
      post_id integer primary key autoincrement,
      author_id integer not null,
      create timestamp not null default current_timestamp,
      title text not null,
      body text not null,
      foreign key (author_id) references post_user (user_id)
  );
  </code></pre>
  
  <p>And my python looks like this:</p>
  
  <pre><code>def init_db():
      db = get_db()
      with current_app.open_resource("schema.sql") as f:
          db.executescript(f.read().decode("utf-8"))
  </code></pre>
  
  <p>And finally the directory:</p>
  
  <pre><code>root
   |--db.py
   |--schema.sql
  instance
   |-- project.sqlite
  </code></pre>
  
  <p>I'm using flask and sqlite3.
  And my troubleshooting steps have been the following:</p>
  
  <p>1) Remove everything except the first line (this works)</p>
  
  <p>2) Removed everything except the first two lines (this doesn't)</p>
  
  <p>3) Remove the <code>./instance/project.sqlite</code> file</p>
  
  <p>4) Use an online validator
      This was especially interesting because this found that each individual command works.
      But as soon as I string two back-to-back it said the commands were invalid.</p>
  
  <p>5) Double checked the sqlite documentation on dropping tables</p>
  
  <p>6) Even went so far as to ensure my <code>.vimrc</code> was set to <code>utf-8</code></p>
  
  <p>I'm sure I've missed something small here but nothing seems to be working.
  Any help would be appreciated!</p>