문제

I'm in the middle of building CMS/CRM for my company using CodeIgniter and I need a way to add deleted items to a trash queue.

So how would you approach the problem of removing a record on delete and placing it in another table? I would also require a way to re-instate the record from the trash queue.

Any thoughts on this would be very much welcomed. Thanks.

도움이 되었습니까?

해결책

I would just use a column on your table called deleted TINYINT(1) That way you could just flag it as being deleted and you don't need to move it to any other table. So you would just update the record instead of deleting it. UPDATE table_name SET deleted = 1 WHERE id = 1

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top