September 4th, 2013, 06:39 AM
I created a voucher system previously where if anyone registers to my site, they get sent a voucher they can use. In that system I would "delete" the voucher from my table. (Table only had 1 column of voucher).
I have to create another similar system, I am now wondering IF i should change the table structure to vouchers ( voucher, timestamp, user_email ). This way vouchers will stay in my table and I can get a bit more info). Although this extra info isn't really needed.
So should i create this new system exactly like before, deleting vouchers after sending them to the user OR make it more "informative".
September 4th, 2013, 07:05 AM
Keep the vouchers. If there's a bug, or some member claims they've lost the voucher without using it, you'll at least have some info to investigate the issue. Otherwise, you have literally nothing.
Actually deleting things is usually a bad idea, especially when you have a proper database layout with foreign keys.
September 4th, 2013, 07:32 AM
thanks (as always). I was leaning towards this but I thought this is "extra work". Yeah you are right, shouldnt delete in general, just use a status & update that with 1 or 0.