diff options
| author | Barry Warsaw | 2012-04-08 19:40:38 -0400 |
|---|---|---|
| committer | Barry Warsaw | 2012-04-08 19:40:38 -0400 |
| commit | fdfc98239de2cfdfff6c62a5bb9d49abc8d3722e (patch) | |
| tree | 15944f47693c8dbf3fd80292112d5f9d1ccac4d5 /src/mailman/database/schema | |
| parent | 2410fe8c2578fbd11275cfc7fc1897173eecd41a (diff) | |
| download | mailman-fdfc98239de2cfdfff6c62a5bb9d49abc8d3722e.tar.gz mailman-fdfc98239de2cfdfff6c62a5bb9d49abc8d3722e.tar.zst mailman-fdfc98239de2cfdfff6c62a5bb9d49abc8d3722e.zip | |
- Rename the model attributes.
- news_moderation -> newsgroup_moderation
Diffstat (limited to 'src/mailman/database/schema')
| -rw-r--r-- | src/mailman/database/schema/mm_20120407000000.py | 14 | ||||
| -rw-r--r-- | src/mailman/database/schema/sqlite_20120407000000_01.sql | 5 |
2 files changed, 11 insertions, 8 deletions
diff --git a/src/mailman/database/schema/mm_20120407000000.py b/src/mailman/database/schema/mm_20120407000000.py index 84c563d45..bfeb1060b 100644 --- a/src/mailman/database/schema/mm_20120407000000.py +++ b/src/mailman/database/schema/mm_20120407000000.py @@ -48,10 +48,10 @@ 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, archive, archive_private ' - 'from mailinglist;') + 'select id, news_prefix_subject_too, news_moderation, ' + 'archive, archive_private from mailinglist;') for value in results: - id, news_prefix, archive, archive_private = value + id, news_prefix, news_moderation, archive, archive_private = value # Figure out what the new archive_policy column value should be. if archive == 0: archive_policy = int(ArchivePolicy.never) @@ -61,8 +61,10 @@ def upgrade_sqlite(database, store, version, module_path): archive_policy = int(ArchivePolicy.public) store.execute( 'update ml_backup set ' - ' nntp_prefix_subject_too = {0}, ' - ' archive_policy = {1} ' - 'where id = {2};'.format(news_prefix, archive_policy, id)) + ' nntp_moderation = {0}, ' + ' nntp_prefix_subject_too = {1}, ' + ' archive_policy = {2} ' + 'where id = {2};'.format(news_moderation, news_prefix, + archive_policy, 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 4fae9ed9d..58201fb9b 100644 --- a/src/mailman/database/schema/sqlite_20120407000000_01.sql +++ b/src/mailman/database/schema/sqlite_20120407000000_01.sql @@ -10,11 +10,13 @@ -- REM archive -- REM archive_private -- REM archive_volume_frequency +-- REM news_moderation -- REM news_prefix_subject_too -- REM nntp_host -- -- THESE COLUMNS ARE ADDED BY THE PYTHON MIGRATION LAYER: -- ADD archive_policy +-- ADD newsgroup_moderation -- ADD nntp_prefix_subject_too -- LP: #971013 @@ -95,7 +97,6 @@ CREATE TABLE ml_backup( mime_is_default_digest BOOLEAN, moderator_password TEXT, new_member_options INTEGER, - news_moderation INTEGER, nondigestable BOOLEAN, nonmember_rejection_notice TEXT, obscure_addresses BOOLEAN, @@ -206,7 +207,6 @@ INSERT INTO ml_backup SELECT mime_is_default_digest, moderator_password, new_member_options, - news_moderation, nondigestable, nonmember_rejection_notice, obscure_addresses, @@ -241,3 +241,4 @@ INSERT INTO ml_backup SELECT -- Add the new columns. They'll get inserted at the Python layer. ALTER TABLE ml_backup ADD COLUMN archive_policy INTEGER; ALTER TABLE ml_backup ADD COLUMN nntp_prefix_subject_too INTEGER; +ALTER TABLE ml_backup ADD COLUMN newsgroup_moderation INTEGER; |
