Merge lp:~raoul-snyman/openlp/bug-714510 into lp:openlp
Proposed by
Raoul Snyman
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 1596 | ||||
Proposed branch: | lp:~raoul-snyman/openlp/bug-714510 | ||||
Merge into: | lp:openlp | ||||
Diff against target: |
83 lines (+5/-25) 3 files modified
openlp/plugins/songs/lib/db.py (+3/-24) openlp/plugins/songs/lib/mediaitem.py (+1/-0) openlp/plugins/songs/lib/xml.py (+1/-1) |
||||
To merge this branch: | bzr merge lp:~raoul-snyman/openlp/bug-714510 | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Jonathan Corwin (community) | Approve | ||
Review via email: mp+62866@code.launchpad.net |
This proposal supersedes a proposal from 2011-05-30.
Commit message
Fix bug #714510 by removing the unnecessary indexes and defaulting the song_book_id on the songs table to NULL instead of 0.
Description of the change
Fix bug #714510 by removing the indexes, which were unnecessary and caused various foreign key constraints in real relational databases like InnoDB and PostgreSQL. I also defaulted the song book id on songs to NULL instead of 0, since NULL is a valid value for foreign keys.
To post a comment you must log in.
Part way there, I was able to start OpenLP and create a new song.
Then I loaded an existing service file which contained songs that weren't in the database, and I got:
Traceback (most recent call last): jonathan\ Documents\ projects\ openlp\bug-714510\openlp\ plugins\ songs\lib\ mediaitem. py", line 480, in serviceLoad .xml_to_ song(item. xml_version) jonathan\ Documents\ projects\ openlp\bug-714510\openlp\ plugins\ songs\lib\ xml.py" , line 343, in xml_to_song manager. save_object( song) jonathan\ Documents\ projects\ openlp\bug-714510\openlp\ core\lib\ db.py", line 152, in save_object session. commit( ) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\scoping. py", line 139, in do self.registry( ), name)(*args, **kwargs) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\session. py", line 614, in commit transaction. commit( ) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\session. py", line 385, in commit _prepare_ impl() lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\session. py", line 369, in _prepare_impl session. flush() lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\session. py", line 1388, in flush _flush( objects) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\session. py", line 1469, in _flush context. execute( ) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\unitofwor k.py", line 302, in execute execute( self) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\unitofwor k.py", line 446, in execute lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\orm\mapper. py", line 1878, in _save_obj statement, params) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ base.py" , line 1191, in execute lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ base.py" , line 1271, in _execute_ clauseelement execute_ context( context) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ base.py" , line 1302, in __execute_context parameters[ 0], context=context) lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ base.py" , line 1401, in _cursor_execute lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ base.py" , line 1394, in _cursor_execute lib\site- packages\ sqlalchemy- 0.6.6-py2. 7.egg\sqlalchem y\engine\ default. py", line 299, in do_execute execute( statement, parameters) lib\site- packages\ MySQLdb\ cursors. py", line 174, in execute errorhandler( self, exc, value) lib\site- packages\ MySQLdb\ connections. py", line 36, in defaulterrorhandler
File "C:\Users\
editId = self.openLyrics
File "C:\Users\
self.
File "C:\Users\
self.
File "C:\Python27\
return getattr(
File "C:\Python27\
self.
File "C:\Python27\
self.
File "C:\Python27\
self.
File "C:\Python27\
self.
File "C:\Python27\
flush_
File "C:\Python27\
rec.
File "C:\Python27\
uow
File "C:\Python27\
execute(
File "C:\Python27\
params)
File "C:\Python27\
return self.__
File "C:\Python27\
context.
File "C:\Python27\
context)
File "C:\Python27\
context)
File "C:\Python27\
cursor.
File "C:\Python27\
self.
File "C:\Python27\
raise errorclass, errorvalue
IntegrityError: (IntegrityError) (1452, 'Cannot add or update a child row: a ...