<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hello,<br>
<br>
cannot doc_uri be just unique key? It is how we have the db schema,
id is primary key and the other constraints are unique keys -- it
worked very well so far with all db engines.<br>
<br>
Cheers,<br>
Daniel<br>
<br>
On 3/20/12 11:09 AM, Peter Dunkley wrote:
<blockquote cite="mid:1332238154.2808.2.camel@pd-laptop-linux"
type="cite">
<meta http-equiv="Content-Type" content="text/html;
charset=ISO-8859-1">
<meta name="GENERATOR" content="GtkHTML/4.2.3">
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:
> utils/kamctl/mysql/presence-create.sql | 22
> +++++++++++++---------
peter,
something went wrong with this commit. at least mysql version of
resulting xcap table is now incorrect:
mysql> CREATE TABLE xcap (
-> id INT(10) UNSIGNED AUTO_INCREMENT NOT NULL,
-> username VARCHAR(64) NOT NULL,
-> domain VARCHAR(64) NOT NULL,
-> doc MEDIUMBLOB NOT NULL,
-> doc_type INT(11) NOT NULL,
-> etag VARCHAR(64) NOT NULL,
-> source INT(11) NOT NULL,
-> doc_uri VARCHAR(255) PRIMARY KEY NOT NULL,
-> port INT(11) NOT NULL,
-> CONSTRAINT account_doc_type_idx UNIQUE (username, domain, doc_type),
-> CONSTRAINT account_doc_type_uri_idx UNIQUE (username, domain, doc_type, doc_uri),
-> CONSTRAINT account_doc_uri_idx UNIQUE (username, domain, doc_uri)
-> ) 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 moz-do-not-send="true" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a moz-do-not-send="true" 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 cellpadding="0" cellspacing="0" width="100%">
<tbody>
<tr>
<td>
<pre>--
Peter Dunkley
Technical Director
Crocodile RCS Ltd
</pre>
</td>
</tr>
</tbody>
</table>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
sr-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:sr-dev@lists.sip-router.org">sr-dev@lists.sip-router.org</a>
<a class="moz-txt-link-freetext" 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>
<pre class="moz-signature" cols="72">--
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
<a class="moz-txt-link-freetext" href="http://www.asipto.com/index.php/kamailio-advanced-training/">http://www.asipto.com/index.php/kamailio-advanced-training/</a></pre>
</body>
</html>