Answers.Body: <p>Not the most direct way, but you could do something like this from your plugin's record:</p>
  
  <pre><code>public function createTable()
  {
      // Let the base class do the actual work
      parent::createTable();
  
      // Change the PK auto-increment starting point.
      craft()-&gt;db-&gt;createCommand()-&gt;setText('ALTER TABLE myTable AUTO_INCREMENT=9999')-&gt;execute();
  
  }
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-04-26T00:56:47.190Z
Answers.LastActivityDate: 2016-04-26T00:56:47.190Z
Answers.UserDisplayName: Brad Bell
Body: <p>Is there a way to define my plugins Record start ID? Now it start with ID 1, and for various reasons I would like to define a starting number.</p>
  
Tags: <plugin-development><records>
Title: Define record start ID
ThreadText: # Define record start ID
  
  (Asked by: username_0 on 2016-04-25)
  
  Is there a way to define my plugins Record start ID? Now it start with ID 1, and for various reasons I would like to define a starting number.
  
  **Tags:** plugin-development, records
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2016-04-26. Score: 2 | Accepted answer
  
  Not the most direct way, but you could do something like this from your plugin's record:
  
  ```
  public function createTable()
  {
      // Let the base class do the actual work
      parent::createTable();
  
      // Change the PK auto-increment starting point.
      craft()->db->createCommand()->setText('ALTER TABLE myTable AUTO_INCREMENT=9999')->execute();
  
  }
  
  ```
  
  
  ---
  
  