'Write the series sort into the existing sort column in the series table'

def upgrade_version_21(self):

    script = u'\n                                DROP    TRIGGER    IF    EXISTS    series_insert_trg;\n                                DROP    TRIGGER    IF    EXISTS    series_update_trg;\n\n                                UPDATE    series    SET    sort=title_sort(name);\n\n                                CREATE    TRIGGER    series_insert_trg\n                                                AFTER    INSERT    ON    series\n                                                BEGIN\n                                                        UPDATE    series    SET    sort=title_sort(NEW.name)    WHERE    id=NEW.id;\n                                                END;\n\n                                CREATE    TRIGGER    series_update_trg\n                                                AFTER    UPDATE    ON    series\n                                                BEGIN\n                                                        UPDATE    series    SET    sort=title_sort(NEW.name)    WHERE    id=NEW.id;\n                                                END;\n                                '
    self.db.execute(script)
