-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
enhancement - REFERENCES and FOREIGN KEY in XML notation #5756
Comments
I don't think sqlite is the problem here. I did some reading on this, and the issue seems to be the support for MyIsam (if using mysql). We had some discussions about this since OC3. You can look into the mailinglist archives for more information on this. Your question is still valid though. And I'd also like to see owncloud use more powerful database features. |
One of the design goal of ownCloud is to Run on as many systems as possible. We don't plan to break compatibility just for fun. And I'm still waiting to see an application that can't be implemented in a cross database compatible way |
@karlitschek Foreign keys are supported with sqlite since 3.6.19 released on 14 October 2009 |
@VicDeo the problem is mysql - see http://dev.mysql.com/doc/refman/5.0/en/ansi-diff-foreign-keys.html @karlitschek what do you think about apps requiring some specific software/backends. e.g. allowing the app to check which database is used and refusing to be installed if it is incompatible? (similar to requiring an OC-core version) |
@VicDeo we have to check if this version is shipped with all distributions that we support. It also has to work in all databases that we Support in a completely compatible Way. And it has to be supported by MDB2 and doctrine so that schema migration works always. And we would need tests for that. We already have more then enough unhappy users with broken databases and this woudn't make things easier. |
@wshadow this would be a bad idea. We have to stay compatible. |
In reality foreign keys are designed to keep the database data consistent by means of Db engine itself. Just as it is stated by the link provided by @wshadow above:
@wshadow So, mandatory InnoDB storage is considered to be a real stumbling block for using constrains, correct? @karlitschek I probably would never say something like 'We need to reimplement everything using a technology X' but rather "let's consider some X in future as it is safe and time-saving" From my POV it is worth to be discussed for OC7 where MDB backward compatibility is not essential (IIRC we don't support direct migrations among nonsequential versions anyway) |
@VicDeo you are correct. So far we allow any storage engine to be used in mysql. If we start using (and relying upon) foreign keys we force admins to switch to InnoDB as their storage engine, if they use mysql. If there is serious interest in discussing this further I'd be willing to write up some pros and cons about using foreign keys in owncloud (-apps). However, this will take a bit, as I have some other projects that I'm working on atm. |
I could understand that compatibility is an issue. But, it's really difficult for some developers to write code to delete the tuples in every table instead of a simple 'ON DELETE CASCADE' command. It is really difficult and a time consuming task for developers. |
@sureshprakash I'm on your side regarding that. Imagine you reference a table from a different app (e.g. a user); it's going to be a pain to notice all the delete and update operations on such an "app external" table. |
I’m closing this issue because it has been inactive for a few months. This probably means that the issue is not reproducible or it has been fixed in a newer version. Please open a new issue if you still encounter this problem with the latest stable version and then please use the issue template. You can also contribute directly by providing a patch – see the developer manual. :) Thank you! |
@jancborchardt when closing the issue you could at least use a fitting text block ;). This is about an enhancement (I'd even go as far as to call it a feature request) and therefore we should use a different text block. |
@wshadow sorry about the missing clarity. :) I’m cleaning up old issues and since Frank stated that we can’t do this because we have to stay compatible, this should be closed. Hope that clears it up. |
Hi,
I am programming a chat-app and need some database-tables for that. I wanted to use REFERENCES and PRIMARY/FOREIGN KEY relations but didn't found anything about that. In ownCloud IRC I got bad news. One of the most powerful features of a database was not implemented because ownCloud wants to support older versions of sqlite...
Please think about it. Is it realy necessary? Maybe it is possible to implement this feature with a securety-check, so when using this feature owncloud must run on a current database version.
Greetings
The text was updated successfully, but these errors were encountered: