Re: SQL Update 2.6.0 -> 2.6.1

From: SM <sm_at_resistor.net>
Date: Wed, 27 Jun 2012 08:08:09 -0700

At 04:33 27-06-2012, Andreas Schulze wrote:
>maybe an sql expert could give me a hint...
>
>2.6.1 changed the mysql database used for the reputation feature.
>There is an new key(msgtime). Here is the relevand diff:
>
>--- opendkim-2.6.0/stats/mkdb.mysql 2012-03-01 00:52:30.000000000 +0100
>+++ opendkim-2.6.1/stats/mkdb.mysql 2012-06-25 05:33:43.000000000 +0200
>_at_@ -1,6 +1,6 @@
> -- $Id: mkdb.mysql,v 1.11 2010/10/25 17:16:00 cm-msk Exp $
>
>--- Copyright (c) 2010, 2011, The OpenDKIM Project. All rights reserved.
>+-- Copyright (c) 2010-2012, The OpenDKIM Project. All rights reserved.
>
> -- MySQL command sequence to create a database to accumulate OpenDKIM
> -- statistics reports
>_at_@ -53,6 +53,7 @@
> key(reporter),
> key(from_domain),
> key(ip),
>+ key(msgtime),
> unique key(reporter, jobid, msgtime),
> foreign key(from_domain) references domains(id) on delete cascade,
> foreign key(ip) references ipaddrs(id) on delete cascade,
>
>
>
>My question: how do I add that key to an existing database?

ALTER TABLE tablename DROP PRIMARY KEY, ADD PRIMARY KEY(reporter,
jobid, msgtime);

Regards,
-sm
Received on Wed Jun 27 2012 - 15:11:26 PST

This archive was generated by hypermail 2.3.0 : Mon Oct 29 2012 - 23:20:40 PST