summaryrefslogtreecommitdiff
path: root/src/mailman/database/schema/mm_20120407000000.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-09-04 22:25:49 -0400
committerBarry Warsaw2012-09-04 22:25:49 -0400
commit952cd3770fe4db4786efcc7c90d72dfa9aa74e68 (patch)
tree17e850760dcb5e1a4a685d9ecc903550771df605 /src/mailman/database/schema/mm_20120407000000.py
parent5d42a53f1166ecaf98be69954894795c44a803a8 (diff)
downloadmailman-952cd3770fe4db4786efcc7c90d72dfa9aa74e68.tar.gz
mailman-952cd3770fe4db4786efcc7c90d72dfa9aa74e68.tar.zst
mailman-952cd3770fe4db4786efcc7c90d72dfa9aa74e68.zip
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;')