~ubuntu-branches/ubuntu/vivid/gpodder/vivid

« back to all changes in this revision

Viewing changes to src/gpodder/dbsqlite.py

  • Committer: Bazaar Package Importer
  • Author(s): tony mancill
  • Date: 2011-05-31 22:05:31 UTC
  • mfrom: (5.2.18 sid)
  • Revision ID: james.westby@ubuntu.com-20110531220531-f3gt49fypbmuair8
Tags: 2.15-2
This time without a patch that reverts the source to 2.14.

Show diffs side-by-side

added added

removed removed

Lines of Context:
700
700
            if not exists_notnull_column:
701
701
                self.recreate_table(cur, table_name, fields, index_list)
702
702
 
 
703
        # Search for a unique index on the "guid" column in
 
704
        # the episodes table and drop it if it exists. It will
 
705
        # be recreated without the unique flag. (Maemo bug 12094)
 
706
        cur.execute('PRAGMA index_list(%s)' % self.TABLE_EPISODES)
 
707
        current_indices = cur.fetchall()
 
708
        for pos, idx_name, idx_is_unique in current_indices:
 
709
            if idx_name == 'idx_guid' and idx_is_unique:
 
710
                log('Fixing unique index (%s) in %s', idx_name, \
 
711
                        self.TABLE_EPISODES, sender=self)
 
712
                cur.execute('DROP INDEX idx_guid')
 
713
                break
 
714
 
703
715
        for column, typ in index_list:
704
716
            cur.execute('CREATE %s IF NOT EXISTS idx_%s ON %s (%s)' % (typ, column, table_name, column))
705
717