<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
  <META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
  <META NAME="GENERATOR" CONTENT="GtkHTML/4.2.3">
</HEAD>
<BODY>
Hi,<BR>
<BR>
That's interesting.<BR>
<BR>
I am using PostgreSQL here, and it seems (with PostgreSQL) at least, an auto-increment field doesn't have to be a primary key - which is good as the doc_uri really should be the primary key on this table.<BR>
<BR>
Is there anyone who is more familiar with the Kamailio DB schema and MySQL who can tell me if there is a way to make ID a non-primary key, and whether or not this will allow ID to be auto-increment?<BR>
<BR>
Thanks,<BR>
<BR>
Peter<BR>
<BR>
On Tue, 2012-03-20 at 09:03 +0200, Juha Heinanen wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Peter Dunkley writes:

&gt;  utils/kamctl/mysql/presence-create.sql     |   22
&gt;  +++++++++++++---------

peter,

something went wrong with this commit.  at least mysql version of
resulting xcap table is now incorrect:

mysql&gt; CREATE TABLE xcap (
    -&gt;     id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
    -&gt;     username VARCHAR(64) NOT NULL,
    -&gt;     domain VARCHAR(64) NOT NULL,
    -&gt;     doc MEDIUMBLOB NOT NULL,
    -&gt;     doc_type INT(11) NOT NULL,
    -&gt;     etag VARCHAR(64) NOT NULL,
    -&gt;     source INT(11) NOT NULL,
    -&gt;     doc_uri VARCHAR(255) PRIMARY KEY NOT NULL,
    -&gt;     port INT(11) NOT NULL,
    -&gt;     CONSTRAINT account_doc_type_idx UNIQUE (username, domain, doc_type),
    -&gt;     CONSTRAINT account_doc_type_uri_idx UNIQUE (username, domain, doc_type, doc_uri),
    -&gt;     CONSTRAINT account_doc_uri_idx UNIQUE (username, domain, doc_uri)
    -&gt; ) ENGINE=MyISAM;
ERROR 1075 (42000): Incorrect table definition; there can be only one auto column and it must be defined as a key

problem is that id field is auto increment field, but does not anymore
have a key.

-- juha

_______________________________________________
sr-dev mailing list
<A HREF="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</A>
<A HREF="http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev">http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev</A>
</PRE>
</BLOCKQUOTE>
<BR>
<TABLE CELLSPACING="0" CELLPADDING="0" WIDTH="100%">
<TR>
<TD>
<PRE>
-- 
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</PRE>
</TD>
</TR>
</TABLE>
</BODY>
</HTML>