title: AttributeError: 'str' object has no attribute 'state_forwards' with django migrations migrations.RunSQL(
body: <p>I am trying to set the autogenerated id of my postgres tables to a start value of 10000 for different models. I used <a href="https://stackoverflow.com/questions/34279652/set-autoincrement-value-in-django-table">this article</a> and did the following:</p>
  <p><code>python3 manage.py makemigrations core --empty</code></p>
  <p>Then in the migration I added:</p>
  <pre><code>    operations = [
          migrations.RunSQL(
                          &quot;ALTER SEQUENCE CORE_ORG_id_seq RESTART WITH 10000&quot;,
                          &quot;ALTER SEQUENCE CORE_USER_id_seq RESTART WITH 10000&quot;,
                          &quot;ALTER SEQUENCE CORE_PARTLISTING_id_seq RESTART WITH 1000&quot;,
                          &quot;ALTER SEQUENCE CORE_BOMITEM_id_seq RESTART WITH 1000&quot;,
                          &quot;ALTER SEQUENCE CORE_MANUFACTURER_id_seq RESTART WITH 1000;&quot;
          ),
          migrations.RunSQL(
                          &quot;ALTER SEQUENCE CORE_BOM_id_seq RESTART WITH 1000&quot;,
                          &quot;ALTER SEQUENCE CORE_SPECIFICPART_id_seq RESTART WITH 10000&quot;,
                          &quot;ALTER SEQUENCE CORE_GENERICPART_id_seq RESTART WITH 10000;&quot;
                          ),
      ]
  </code></pre>
  <p>I put these in two separate lines because I was getting an error that <code>__init.py__</code> could only take 6 commands btw.</p>
  <p>When I run migrate on this, I get:</p>
  <pre><code>  File &quot;manage.py&quot;, line 21, in &lt;module&gt;
      main()
    File &quot;manage.py&quot;, line 17, in main
      execute_from_command_line(sys.argv)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/__init__.py&quot;, line 401, in execute_from_command_line
      utility.execute()
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/__init__.py&quot;, line 395, in execute
      self.fetch_command(subcommand).run_from_argv(self.argv)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 330, in run_from_argv
      self.execute(*args, **cmd_options)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 371, in execute
      output = self.handle(*args, **options)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/base.py&quot;, line 85, in wrapped
      res = handle_func(*args, **kwargs)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/core/management/commands/migrate.py&quot;, line 243, in handle
      post_migrate_state = executor.migrate(
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/db/migrations/executor.py&quot;, line 117, in migrate
      state = self._migrate_all_forwards(state, plan, full_plan, fake=fake, fake_initial=fake_initial)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/db/migrations/executor.py&quot;, line 147, in _migrate_all_forwards
      state = self.apply_migration(state, migration, fake=fake, fake_initial=fake_initial)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/db/migrations/executor.py&quot;, line 227, in apply_migration
      state = migration.apply(state, schema_editor)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/db/migrations/migration.py&quot;, line 114, in apply
      operation.state_forwards(self.app_label, project_state)
    File &quot;/Users/myname/.local/share/virtualenvs/mobiusAPI-NVQT3lgx/lib/python3.8/site-packages/django/db/migrations/operations/special.py&quot;, line 101, in state_forwards
      state_operation.state_forwards(app_label, state)
  AttributeError: 'str' object has no attribute 'state_forwards'
  </code></pre>
  <p>I also tried to run these commands individually in my psql shell and they work so I do not think it is an issue with the models or tables. I want to put this in my migrations though so I make sure it happens if another person sets up a local db. What is state_forwards any why do you get this error?</p>
  <p>Thanks for your help!</p>