summaryrefslogtreecommitdiff
path: root/src/mailman/database/schema
diff options
context:
space:
mode:
authorBarry Warsaw2012-07-25 23:40:46 -0400
committerBarry Warsaw2012-07-25 23:40:46 -0400
commit30ecd410ba83dc32ad021a2d2c841761befe3079 (patch)
treec485245a23e3fee9af5f74a46bb9ee6a7d5888fd /src/mailman/database/schema
parentb60f54fedab835f214f3c88e990ff3bb098e6cad (diff)
downloadmailman-30ecd410ba83dc32ad021a2d2c841761befe3079.tar.gz
mailman-30ecd410ba83dc32ad021a2d2c841761befe3079.tar.zst
mailman-30ecd410ba83dc32ad021a2d2c841761befe3079.zip
Working for SQLite:
include_list_post_header -> allow_list_posts Also add a bunch more migration tests.
Diffstat (limited to 'src/mailman/database/schema')
-rw-r--r--src/mailman/database/schema/mm_20120407000000.py24
-rw-r--r--src/mailman/database/schema/sqlite_20120407000000_01.sql6
2 files changed, 20 insertions, 10 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py
index 9ed99e225..95b56c939 100644
--- a/src/mailman/database/schema/mm_20120407000000.py
+++ b/src/mailman/database/schema/mm_20120407000000.py
@@ -76,20 +76,26 @@ def upgrade_sqlite(database, store, version, module_path):
database.load_schema(
store, version, 'sqlite_{0}_01.sql'.format(version), module_path)
results = store.execute(
- 'SELECT id, news_prefix_subject_too, news_moderation, '
+ 'SELECT id, include_list_post_header, '
+ 'news_prefix_subject_too, news_moderation, '
'archive, archive_private FROM mailinglist;')
for value in results:
- id, news_prefix, news_moderation, archive, archive_private = value
+ (id, list_post,
+ news_prefix, news_moderation,
+ archive, archive_private) = value
# Figure out what the new archive_policy column value should be.
store.execute(
'UPDATE ml_backup SET '
- ' newsgroup_moderation = {0}, '
- ' nntp_prefix_subject_too = {1}, '
- ' archive_policy = {2} '
- 'WHERE id = {3};'.format(news_moderation,
- news_prefix,
- archive_policy(archive, archive_private),
- id))
+ ' allow_list_posts = {0}, '
+ ' newsgroup_moderation = {1}, '
+ ' nntp_prefix_subject_too = {2}, '
+ ' archive_policy = {3} '
+ 'WHERE id = {4};'.format(
+ list_post,
+ news_moderation,
+ news_prefix,
+ archive_policy(archive, archive_private),
+ id))
store.execute('DROP TABLE mailinglist;')
store.execute('ALTER TABLE ml_backup RENAME TO mailinglist;')
diff --git a/src/mailman/database/schema/sqlite_20120407000000_01.sql b/src/mailman/database/schema/sqlite_20120407000000_01.sql
index 58201fb9b..e5d3a39ff 100644
--- a/src/mailman/database/schema/sqlite_20120407000000_01.sql
+++ b/src/mailman/database/schema/sqlite_20120407000000_01.sql
@@ -10,22 +10,26 @@
-- REM archive
-- REM archive_private
-- REM archive_volume_frequency
+-- REM include_list_post_header
-- REM news_moderation
-- REM news_prefix_subject_too
-- REM nntp_host
--
-- THESE COLUMNS ARE ADDED BY THE PYTHON MIGRATION LAYER:
+-- ADD allow_list_posts
-- ADD archive_policy
-- ADD newsgroup_moderation
-- ADD nntp_prefix_subject_too
+
-- LP: #971013
+-- LP: #967238
CREATE TABLE ml_backup(
id INTEGER NOT NULL,
-- List identity
list_name TEXT,
mail_host TEXT,
- include_list_post_header BOOLEAN,
+ allow_list_posts BOOLEAN,
include_rfc2369_headers BOOLEAN,
-- Attributes not directly modifiable via the web u/i
created_at TIMESTAMP,