hi @ all
How can I clean all records from a table in a mysql database without
delete the table in the database? (only use a method in the model)
thanks for helping!
hi @ all
How can I clean all records from a table in a mysql database without
delete the table in the database? (only use a method in the model)
thanks for helping!
Take a look at destroy_all
Aaron
Actually, delete_all might be a better bet in this case because it
runs without instantiating the records first.
Aaron
On Feb 4, 2:23 pm, “K. R.” [email protected] wrote:
Can I overwrite the table with the old structure of the table? Can I use
for this scenario the rake tool? So all records are deleted and the old
structure still the same.
Is this for your development environment and are you using test
fixtures? If so you can easily load test fixtures into your
development database by running “rake db:fixtures:load”.
Aaron
Can I overwrite the table with the old structure of the table? Can I use
for this scenario the rake tool? So all records are deleted and the old
structure still the same.
Aaron wrote:
Is this for your development environment and are you using test
fixtures?
No, but I want to copy / overwrite an existing table with rake in the
same environment. Is it possible with rake? Or with an other solution?
For example: I have a table people and I want to copy this table into
the guests table.
This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.
Sponsor our Newsletter | Privacy Policy | Terms of Service | Remote Ruby Jobs