diff options
| author | Barry Warsaw | 2013-09-01 11:15:08 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2013-09-01 11:15:08 -0400 |
| commit | d146f14b3eef9f608c0e03347c135062bade8ced (patch) | |
| tree | 5a1f2f576dd7d5dcce4d6903df5cc4b6cb754815 /src/mailman/database/schema/mm_20120407000000.py | |
| parent | 41059ed20ec668baf41cceaf539f8017171e9651 (diff) | |
| download | mailman-d146f14b3eef9f608c0e03347c135062bade8ced.tar.gz mailman-d146f14b3eef9f608c0e03347c135062bade8ced.tar.zst mailman-d146f14b3eef9f608c0e03347c135062bade8ced.zip | |
Diffstat (limited to 'src/mailman/database/schema/mm_20120407000000.py')
| -rw-r--r-- | src/mailman/database/schema/mm_20120407000000.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py index 8855df5af..463635fd9 100644 --- a/src/mailman/database/schema/mm_20120407000000.py +++ b/src/mailman/database/schema/mm_20120407000000.py @@ -48,11 +48,11 @@ __all__ = [ ] +from mailman.database.schema.helpers import pivot from mailman.interfaces.archiver import ArchivePolicy VERSION = '20120407000000' -_helper = None @@ -98,7 +98,7 @@ def upgrade_sqlite(database, store, version, module_path): list_id = '{0}.{1}'.format(list_name, mail_host) fqdn_listname = '{0}@{1}'.format(list_name, mail_host) store.execute(""" - UPDATE ml_backup SET + UPDATE mailinglist_backup SET allow_list_posts = {0}, newsgroup_moderation = {1}, nntp_prefix_subject_too = {2}, @@ -120,8 +120,7 @@ def upgrade_sqlite(database, store, version, module_path): WHERE mailing_list = '{1}'; """.format(list_id, fqdn_listname)) # Pivot the backup table to the real thing. - store.execute('DROP TABLE mailinglist;') - store.execute('ALTER TABLE ml_backup RENAME TO mailinglist;') + pivot(store, 'mailinglist') # Now add some indexes that were previously missing. store.execute( 'CREATE INDEX ix_mailinglist_list_id ON mailinglist (list_id);') @@ -137,12 +136,11 @@ def upgrade_sqlite(database, store, version, module_path): else: list_id = '{0}.{1}'.format(list_name, mail_host) store.execute(""" - UPDATE mem_backup SET list_id = '{0}' + UPDATE member_backup SET list_id = '{0}' WHERE id = {1}; """.format(list_id, id)) # Pivot the backup table to the real thing. - store.execute('DROP TABLE member;') - store.execute('ALTER TABLE mem_backup RENAME TO member;') + pivot(store, 'member') |
