title: How to fix 'django.db.utils.OperationalError: near "None": syntax error' db.sqlite3?
body: <p>I am attempting to create a user model for my Django REST framework and, sadly, I'm experiencing some unexpected difficulty: when I run 'python manage.py makemigrations' everything functions as it should, but, when I try to run a migration, I am greeted with this error 'return Database.Cursor.execute(self, query) django.db.utils.OperationalError: near "None": syntax error'.</p>
  
  <p>I've tried altering the code in the models.py but it still yielded the same results, even if I set the user model class to only have one id field. I am using django version 1.11.17 and drf version 3.9.0</p>
  
  <p>models.py:</p>
  
  <pre><code>class User(models.Model):
      id = models.AutoField(primary_key=True)
  
      email = models.CharField(unique=True, null=False, max_length=200)
      phone = models.IntegerField(unique=True, null=False)
      first_name = models.CharField(null=False, max_length=200)
      last_name = models.CharField(null=False, max_length=200)
      is_active = models.BooleanField(_('active'), default=False)
      last_seen = models.DateTimeField(auto_now=True, null=True)
      updated_at = models.DateTimeField(auto_now=True, null=True)
      created_at = models.DateTimeField(auto_now_add=True, null=True)
  
      avatar = models.CharField(null=True)
  </code></pre>
  
  <p>migrations/0001_initial.py:</p>
  
  <pre><code>class Migration(migrations.Migration):
  
      initial = True
  
      dependencies = [
      ]
  
      operations = [
      migrations.CreateModel(
          name='User',
          fields=[
              ('id', models.AutoField(primary_key=True, serialize=False)),
              ('email', models.CharField(max_length=200, unique=True)),
              ('phone', models.IntegerField(unique=True)),
              ('first_name', models.CharField(max_length=200)),
              ('last_name', models.CharField(max_length=200)),
              ('last_seen', models.DateTimeField(auto_now=True, null=True)),
              ('updated_at', models.DateTimeField(auto_now=True, null=True)),
              ('created_at', models.DateTimeField(auto_now_add=True, null=True)),
              ('avatar', models.CharField(null=True)),
          ],
      ),
  ]
  </code></pre>
  
  <p>full stack trace:</p>
  
  <pre><code>  File "manage.py", line 22, in &lt;module&gt;
      execute_from_command_line(sys.argv)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 364, in execute_from_command_line
      utility.execute()
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/core/management/__init__.py", line 356, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/core/management/base.py", line 283, in run_from_argv
      self.execute(*args, **cmd_options)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/core/management/base.py", line 330, in execute
      output = self.handle(*args, **options)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/core/management/commands/migrate.py", line 204, in handle
      fake_initial=fake_initial,
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/migrations/executor.py", line 115, in migrate
      state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/migrations/executor.py", line 145, in _migrate_all_forwards
      state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/migrations/executor.py", line 244, in apply_migration
      state = migration.apply(state, schema_editor)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/migrations/migration.py", line 129, in apply
      operation.database_forwards(self.app_label, schema_editor, old_state, project_state)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/migrations/operations/models.py", line 97, in database_forwards
      schema_editor.create_model(model)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 319, in create_model
      self.execute(sql, params or None)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/base/schema.py", line 136, in execute
      cursor.execute(sql, params)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/utils.py", line 79, in execute
      return super(CursorDebugWrapper, self).execute(sql, params)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/utils.py", line 64, in execute
      return self.cursor.execute(sql, params)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/utils.py", line 94, in __exit__
      six.reraise(dj_exc_type, dj_exc_value, traceback)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/utils.py", line 62, in execute
      return self.cursor.execute(sql)
    File "/Users/my_username/myapp/myapp/lib/python2.7/site-packages/django/db/backends/sqlite3/base.py", line 326, in execute
      return Database.Cursor.execute(self, query)
    django.db.utils.OperationalError: near "None": syntax error
  </code></pre>
  
  <p>I want to be able to successfully run the migration.</p>