summaryrefslogtreecommitdiff
path: root/src/mailman/database/schema/mm_20120407000000.py
diff options
context:
space:
mode:
authorBarry Warsaw2012-08-20 11:06:03 -0400
committerBarry Warsaw2012-08-20 11:06:03 -0400
commit5ad4218c2fb6cdaf735b09e71369fd01be12a332 (patch)
tree6e31f4a496d1cfce2267d668ca0d280d50b2857a /src/mailman/database/schema/mm_20120407000000.py
parent33092bbbab94df6170104e6c4f888c424d589cbf (diff)
downloadmailman-5ad4218c2fb6cdaf735b09e71369fd01be12a332.tar.gz
mailman-5ad4218c2fb6cdaf735b09e71369fd01be12a332.tar.zst
mailman-5ad4218c2fb6cdaf735b09e71369fd01be12a332.zip
A few fixes for schema migration on PostgreSQL.
- migration.rst needs special cleanup since the Version table is no longer wiped by the test machinery. This only caused failures when running the migration.rst test multiple times, and only on PostgreSQL. - Complete the removal of archive_volume_frequency and generic_nonmember_action for PostgreSQL. - Remove setting archive_volume_frequency in the default style.
Diffstat (limited to 'src/mailman/database/schema/mm_20120407000000.py')
-rw-r--r--src/mailman/database/schema/mm_20120407000000.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py
index 89bc52eca..068a05834 100644
--- a/src/mailman/database/schema/mm_20120407000000.py
+++ b/src/mailman/database/schema/mm_20120407000000.py
@@ -27,6 +27,7 @@ All column changes are in the `mailinglist` table.
- archive, archive_private -> archive_policy
* Remove:
+ - archive_volume_frequency
- generic_nonmember_action
- nntp_host
@@ -116,8 +117,12 @@ def upgrade_postgres(database, store, version, module_path):
store.execute(
'ALTER TABLE mailinglist '
' RENAME COLUMN include_list_post_header TO allow_list_posts;')
- # Do the column drop next.
- store.execute('ALTER TABLE mailinglist DROP COLUMN nntp_host;')
+ # Do the easy column drops next.
+ for column in ('archive_volume_frequency',
+ 'generic_nonmember_action',
+ 'nntp_host'):
+ store.execute(
+ 'ALTER TABLE mailinglist DROP COLUMN {0};'.format(column))
# Now do the trickier collapsing of values. Add the new columns.
store.execute('ALTER TABLE mailinglist ADD COLUMN archive_policy INTEGER;')
# Query the database for the old values of archive and archive_private in
@@ -131,7 +136,7 @@ def upgrade_postgres(database, store, version, module_path):
archive_policy(archive, archive_private),
id))
# Now drop the old columns.
- for column in ('archive', 'archive_private', 'generic_nonmember_action'):
+ for column in ('archive', 'archive_private'):
store.execute(
'ALTER TABLE mailinglist DROP COLUMN {0};'.format(column))
# Record the migration in the version table.