ruby on rails 3 - How reset primary key in Active Record with SQLITE3 -
I have this problem. I am creating a table called the post and then I have recorded some records how can I shorten the table so that the post is the primary key again 1 use rake is 1 with db: drop
code for me $ rails console & gt; ActiveRecord :: base.connection.execute ("Remove from sqlite_sequence where name = 'yourtablename'"
Ensure that you are using the appropriate yourtablename
and following the name conventions.The name of the table is always low-case and plural. For example, if your model name If your model name is Image
, then the name of your table will be the image
user
. Code>.
Let me know what is the solution to this problem.
Comments
Post a Comment