diff options
| author | Barry Warsaw | 2012-07-25 23:40:46 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-07-25 23:40:46 -0400 |
| commit | 30ecd410ba83dc32ad021a2d2c841761befe3079 (patch) | |
| tree | c485245a23e3fee9af5f74a46bb9ee6a7d5888fd /src/mailman/database/schema | |
| parent | b60f54fedab835f214f3c88e990ff3bb098e6cad (diff) | |
| download | mailman-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.py | 24 | ||||
| -rw-r--r-- | src/mailman/database/schema/sqlite_20120407000000_01.sql | 6 |
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, |
