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.


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

    // Change the PK auto-increment starting point.
    craft()->db->createCommand()->setText('ALTER TABLE myTable AUTO_INCREMENT=9999')->execute();


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.