summaryrefslogtreecommitdiff
path: root/src/mailman/database/schema/mm_20120407000000.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/database/schema/mm_20120407000000.py')
-rw-r--r--src/mailman/database/schema/mm_20120407000000.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py
index f6dd60be5..f351d60ca 100644
--- a/src/mailman/database/schema/mm_20120407000000.py
+++ b/src/mailman/database/schema/mm_20120407000000.py
@@ -128,6 +128,16 @@ def upgrade_sqlite(database, store, version, module_path):
store.execute(
'CREATE INDEX ix_mailinglist_fqdn_listname '
'ON mailinglist (list_name, mail_host);')
+ # Now, do the member table.
+ results = store.execute('SELECT id, mailing_list FROM member;')
+ for id, mailing_list in results:
+ store.execute("""
+ UPDATE mem_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;')