The mysql dlr table suggested in the documentation by default does not
have a timestamp. You can add a field to the table and then delete
rows older than a certain date.

The suggested table is something like this:

#   CREATE TABLE dlr (
#     smsc varchar(40),
#     ts varchar(40),
#     destination varchar(40),
#     source varchar(40),
#     service varchar(40),
#     url varchar(255),
#     mask int(10),
#     status int(10),
#     boxc varchar(40)
#   )

The table I use looks like this:

CREATE TABLE `dlr` (
  `dlr_id` bigint(20) NOT NULL AUTO_INCREMENT,
  `smsc` varchar(255) DEFAULT NULL,
  `ts` varchar(40) DEFAULT NULL,
  `destination` varchar(40) DEFAULT NULL,
  `source` varchar(40) DEFAULT NULL,
  `service` varchar(40) DEFAULT NULL,
  `url` varchar(2048) DEFAULT NULL,
  `mask` int(10) DEFAULT NULL,
  `status` int(10) DEFAULT NULL,
  `boxc` varchar(40) DEFAULT NULL,
  `modified_dt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  PRIMARY KEY (`dlr_id`),
  KEY `idx_smsc_ts` (`smsc`,`ts`)
)


On Tue, Feb 1, 2011 at 8:45 PM, T.K.Thapa <[email protected]> wrote:
>
> Hello,
>
> Is there any automated (or manual) way to clear mysql dlr in dlr table if 
> they are lets say one week old?
>
> Regards
> Tapan Thapa
>

Reply via email to