openlp-core team mailing list archive
-
openlp-core team
-
Mailing list archive
-
Message #09494
[Merge] lp:~raoul-snyman/openlp/bug-714510 into lp:openlp
Raoul Snyman has proposed merging lp:~raoul-snyman/openlp/bug-714510 into lp:openlp.
Requested reviews:
OpenLP Core (openlp-core)
For more details, see:
https://code.launchpad.net/~raoul-snyman/openlp/bug-714510/+merge/62846
Fix bug #714510 by removing the indexes, which were unnecessary and caused various foreign key constraints in real relational databases like InnoDB and PostgreSQL.
--
https://code.launchpad.net/~raoul-snyman/openlp/bug-714510/+merge/62846
Your team OpenLP Core is requested to review the proposed merge of lp:~raoul-snyman/openlp/bug-714510 into lp:openlp.
=== modified file 'openlp/plugins/songs/lib/db.py'
--- openlp/plugins/songs/lib/db.py 2011-05-27 08:21:23 +0000
+++ openlp/plugins/songs/lib/db.py 2011-05-30 07:57:27 +0000
@@ -165,7 +165,7 @@
Column(u'id', types.Integer, primary_key=True),
Column(u'first_name', types.Unicode(128)),
Column(u'last_name', types.Unicode(128)),
- Column(u'display_name', types.Unicode(255), nullable=False)
+ Column(u'display_name', types.Unicode(255), index=True, nullable=False)
)
# Definition of the "media_files" table
@@ -186,7 +186,7 @@
songs_table = Table(u'songs', metadata,
Column(u'id', types.Integer, primary_key=True),
Column(u'song_book_id', types.Integer,
- ForeignKey(u'song_books.id'), default=0),
+ ForeignKey(u'song_books.id'), default=None),
Column(u'title', types.Unicode(255), nullable=False),
Column(u'alternate_title', types.Unicode(255)),
Column(u'lyrics', types.UnicodeText, nullable=False),
@@ -203,7 +203,7 @@
# Definition of the "topics" table
topics_table = Table(u'topics', metadata,
Column(u'id', types.Integer, primary_key=True),
- Column(u'name', types.Unicode(128), nullable=False)
+ Column(u'name', types.Unicode(128), index=True, nullable=False)
)
# Definition of the "authors_songs" table
@@ -230,27 +230,6 @@
ForeignKey(u'topics.id'), primary_key=True)
)
- # Define table indexes
- Index(u'authors_id', authors_table.c.id)
- Index(u'authors_display_name_id', authors_table.c.display_name,
- authors_table.c.id)
- Index(u'media_files_id', media_files_table.c.id)
- Index(u'song_books_id', song_books_table.c.id)
- Index(u'songs_id', songs_table.c.id)
- Index(u'topics_id', topics_table.c.id)
- Index(u'authors_songs_author', authors_songs_table.c.author_id,
- authors_songs_table.c.song_id)
- Index(u'authors_songs_song', authors_songs_table.c.song_id,
- authors_songs_table.c.author_id)
- Index(u'media_files_songs_file', media_files_songs_table.c.media_file_id,
- media_files_songs_table.c.song_id)
- Index(u'media_files_songs_song', media_files_songs_table.c.song_id,
- media_files_songs_table.c.media_file_id)
- Index(u'topics_song_topic', songs_topics_table.c.topic_id,
- songs_topics_table.c.song_id)
- Index(u'topics_song_song', songs_topics_table.c.song_id,
- songs_topics_table.c.topic_id)
-
mapper(Author, authors_table)
mapper(Book, song_books_table)
mapper(MediaFile, media_files_table)
Follow ups