I need to store historical data for something in mysql (only last 7 days) – should I just make an extra column for each or what is the acceptable way to?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
if you want to store historical data for last 7 days only,
add a date-time column to store the record creation time-stamp,
and setup a cronjob to periodically remove the records which old than 7 days
if you are using file-based data (csv),
make sure categories data into different date,
and each file contains a single date,
use the find command to remove (I assume you are using linux)