winton / acts_as_archive

Don't delete your records, move them to a different table
MIT License
372 stars 87 forks source link

Change command on object to generate a migration instead of directly creating the tables #1

Closed nielsm closed 14 years ago

nielsm commented 14 years ago

As currently implemented, deployments thru Capistrano are much harder as you have to manually go into the production environment & run the command. If the command instead generated the migration, it could be deployed exactly the same as before thru cap deploy:migrations.

winton commented 14 years ago

Hello,

This actually is possible, but not documented. You would simply put this line in a migration of your choosing:

ActsAsArchive.update Article, Comment

Of course you would replace "Article, Comment" with your models. I will update the README with this information and then close this ticket out.

look commented 14 years ago

winton, thanks for adding the docs for this. I figured out how to do this while hacking on the code, but I thought I'd need to add this functionality.

winton commented 14 years ago

No problem at all. I can't think of a logical reason why we didn't deploy this using migrations, but there was a reason. We deployed a little under a year ago, so my memory fails me :)

ramontayag commented 13 years ago

I ran rake db:migrate as shown in the README but can't find any trace of these new tables. I came here and saw this, and tried it too, but it doesn't seem to work.