<html><head/><body><html><head></head><body>Which database are you using? And which tables lack an autoincrement id and a manually defined Index, too? AFAIR the core database schema defines indexes for all full table scans that appear in the Core code. A customer found some missing ones in OC4.5 but they were missing because I backported the new Gallery to 4.5 for them. OC5 I think is all peachy.<br>
<br>
With regard to foreign keys let me tell you that from a practical perspective you don't want to have them defined in your database for the following reason: at some point in time you will want to store a partially complete or inconsistent model in your database (eg, because you need to save work in progress). That will be the time you curse your foreign keys, because they were invented to prevent you from doing that. Especially migrations are a lot easier when you can leave depending tupels in a table ... Just my 2 cents.<br><br><div class="gmail_quote"><br>
<br>
Bernhard Posselt <nukeawhale@gmail.com> schrieb:<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<pre style="white-space: pre-wrap; word-wrap:break-word; font-family: sans-serif; margin-top: 0px">On 03/18/2013 07:29 PM, Daniel Danger wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #729fcf; padding-left: 1ex;">Hi,<br /><br />On 03/18/2013 07:05 PM, AndrĂ© Schild wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">Am 18.03.2013 18:49, schrieb Bernhard Posselt:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">On 03/18/2013 06:48 PM, Thomas Tanghus wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #fcaf3e; padding-left: 1ex;">On Monday 18 March 2013 17:15 Bernhard Posselt wrote:<br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #e9b96e; padding-left: 1ex;">I've tried adding those 
 fields
and removing the primary key values from<br />the indices fields (why the fuck are they even in there!?)<br /></blockquote></blockquote></blockquote></blockquote>Defining a primary key in the MDB2 Schema definition has some pitfalls.<br />quoting from<br /><a href="https://raw.github.com/pear/MDB2_Schema/master/docs/xml_schema_documentation.html">https://raw.github.com/pear/MDB2_Schema/master/docs/xml_schema_documentation.html</a><br />:<br />1) <autoincrement>: "Boolean flag property that specifies whether the<br />field should be an auto incrementing not null integer field with a<br />primary key."<br />2) <primary>: "Boolean flag property that specifies whether the<br />combination of the values of the index fields on each row of the table<br />should be a primary key."<br /><br />Keep in mind, that the autoincrement tag is only defined within a<br /><field> declaration and the primary tag is only defined within a <index><br />declaration.<br /><br
/><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;"><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #8ae234; padding-left: 1ex;">Yeah but if the field that the index refers to is a primary key, then<br />so is the index. Or am i wrong?<br /></blockquote>Some databases automatically create indexes for PK fields,<br />for others you have to create a index for PK fields.<br /></blockquote>For all intends and purposes the primary key IS an index. So it makes<br />sense to define it as an index. (in some cases you need the primary key<br />to be composed of more than one field, in which case this is the only<br />way to define it).<br /><br /><blockquote class="gmail_quote" style="margin: 0pt 0pt 1ex 0.8ex; border-left: 1px solid #ad7fa8; padding-left: 1ex;">In a DB schema PK fields makes most sense when you then also use them in<br />foreign keys, that way your data integr
 ity<br
/>is protected by the database.<br /></blockquote>Well, foreign keys are not used in owncloud. myisam doesn't support<br />them. And there are strong advocates for not dropping myisam support.<br /><br />HTH<br />Daniel<br /><hr /><br />Owncloud mailing list<br />Owncloud@kde.org<br /><a href="https://mail.kde.org/mailman/listinfo/owncloud">https://mail.kde.org/mailman/listinfo/owncloud</a><br /></blockquote>ok, just checked: unique, index and autoincrement gets transformed to <br />primary key. Well this is awkward. That doesnt change the fact that the <br />schema is missing tons of primary keys though.<br /><hr /><br />Owncloud mailing list<br />Owncloud@kde.org<br /><a href="https://mail.kde.org/mailman/listinfo/owncloud">https://mail.kde.org/mailman/listinfo/owncloud</a><br /></pre></blockquote></div><br>
-- <br>
Diese Nachricht wurde von meinem Android-Mobiltelefon mit K-9 Mail gesendet.</body></html></body></html>