I want to truncate my Database Table, with CakePHP Model, I have used $this->Model->deleteAll code for the same, and it works fine.
Now, What i want is, next time whenever my new records are inserting, it should start ID with 1 only, which does not work with deleteAll function, so Is there any default CakePHP Syntax to make table Truncate ?
Let me know !
NOTE: This answer is valid only up to CakePHP 1.3. I haven’t used this on the never versions so I’ve no idea whether it works.
deleteAllonly deletes the data, it does not truncate the table.You’ll need to call the
query()method.http://book.cakephp.org/view/1027/query