كيفية مسح البيانات الأقدم من 3 شهور؟

hey!

How do i keep only last 3 months’ data and purge the rest? Via admin console? Thanks.

What data? What problem are you solving?

إعجابَين (2)

Thank you for your reply. We are trying to see how we can reduce the db size on our stage environment.

You’d have to restore the whole database, so what’s the point? And if you deleted a bunch of data then it wouldn’t be useful as a test of what’s on production?

But there is a PostDestroyer and you could do a User.where(something).destroy_all, but that doesn’t seem very useful

What do you think you’re going to test on the staging site if it isn’t the data from production? Maybe you just want to generate some bogus data? I think there is a rake task for that.

إعجاب واحد (1)

yes, i just want last one month’s data. I dont need the rest.

Yes, there’s a task:

إعجاب واحد (1)