Skip to content
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

videodb: add a delete trigger for the files table #6972

Merged
merged 1 commit into from
Apr 18, 2015

Conversation

Montellese
Copy link
Member

This adds an SQL trigger for deletes on the files table so that we don't have to remember to clean up all those other tables that have a foreign key on the files table. Right now there's only one place but there'll be others in the future (in some of my work) and since it doesn't hurt adding it already I thought I put up a PR.

@Montellese Montellese added the Type: Improvement non-breaking change which improves existing functionality label Apr 18, 2015
@mkortstiege mkortstiege added this to the Isengard 15.0-beta1 milestone Apr 18, 2015
@mkortstiege
Copy link
Member

+1 Thanks.

@Montellese
Copy link
Member Author

jenkins build and merge

@xhaggi
Copy link
Member

xhaggi commented Apr 18, 2015

@Montellese do we need a database version bump?

@Montellese
Copy link
Member Author

@xhaggi: Thanks for the reminder. Forgot to cherry-pick that one.

@Montellese
Copy link
Member Author

jenkins build and merge

@Jalle19
Copy link
Member

Jalle19 commented Apr 18, 2015

Wouldn't ON DELETE CASCADE be more suitable?

@xhaggi
Copy link
Member

xhaggi commented Apr 18, 2015

there is no cascading in MySQL MyISAM only InnoDB. if we force innodb then we could use it instead of delete trigger, but keep in mind we need foreign key constraints.

@Montellese
Copy link
Member Author

First of all I'm not a fan of CASCADE because you loose absolute control over what is happening. Secondly (as already explained by @xhaggi) it's not supported everywhere and we don't have any explicit foreign key contraints etc.

@Montellese
Copy link
Member Author

OSX build error is unrelated. Any objections?

@Jalle19
Copy link
Member

Jalle19 commented Apr 18, 2015

Fine by me

Montellese added a commit that referenced this pull request Apr 18, 2015
videodb: add a delete trigger for the files table
@Montellese Montellese merged commit 14edc6c into xbmc:master Apr 18, 2015
@Montellese Montellese deleted the videodb_files_delete_trigger branch April 18, 2015 21:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Improvement non-breaking change which improves existing functionality v15 Isengard
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants