~sambuddhabasu1/mailman/fix_mailman_run_error

« back to all changes in this revision

Viewing changes to src/mailman/database/schema/sqlite_20120407000000_01.sql

  • Committer: Barry Warsaw
  • Date: 2014-11-01 16:49:15 UTC
  • mfrom: (7251.1.38 abhilash)
  • Revision ID: barry@list.org-20141101164915-06wqfmya6wf47n6n
Database
--------
 * The ORM layer, previously implemented with Storm, has been replaced by
   SQLAlchemy, thanks to the fantastic work by Abhilash Raj and Aurélien
   Bompard.  Alembic is now used for all database schema migrations.
 * The new logger `mailman.database` logs any errors at the database layer.

API
---
 * Several changes to the internal API:
   - `IListManager.mailing_lists` is guaranteed to be sorted in List-ID order.
   - `IDomains.mailing_lists` is guaranteed to be sorted in List-ID order.
   - Iteration over domains via the `IDomainManager` is guaranteed to be sorted
     by `IDomain.mail_host` order.
   - `ITemporaryDatabase` interface and all implementations are removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
--
2
 
 
3
 
 
4
 
--
5
 
 
6
 
 
7
 
 
8
 
 
9
 
 
10
 
 
11
 
CREATE TABLE mailinglist_backup (
12
 
    id INTEGER NOT NULL,
13
 
    -- List identity
14
 
    list_name TEXT,
15
 
    mail_host TEXT,
16
 
    allow_list_posts BOOLEAN,
17
 
    include_rfc2369_headers BOOLEAN,
18
 
    -- Attributes not directly modifiable via the web u/i
19
 
    created_at TIMESTAMP,
20
 
    admin_member_chunksize INTEGER,
21
 
    next_request_id INTEGER,
22
 
    next_digest_number INTEGER,
23
 
    digest_last_sent_at TIMESTAMP,
24
 
    volume INTEGER,
25
 
    last_post_at TIMESTAMP,
26
 
    accept_these_nonmembers BLOB,
27
 
    acceptable_aliases_id INTEGER,
28
 
    admin_immed_notify BOOLEAN,
29
 
    admin_notify_mchanges BOOLEAN,
30
 
    administrivia BOOLEAN,
31
 
    advertised BOOLEAN,
32
 
    anonymous_list BOOLEAN,
33
 
    -- Automatic responses.
34
 
    autorespond_owner INTEGER,
35
 
    autoresponse_owner_text TEXT,
36
 
    autorespond_postings INTEGER,
37
 
    autoresponse_postings_text TEXT,
38
 
    autorespond_requests INTEGER,
39
 
    autoresponse_request_text TEXT,
40
 
    autoresponse_grace_period TEXT,
41
 
    -- Bounces.
42
 
    forward_unrecognized_bounces_to INTEGER,
43
 
    process_bounces BOOLEAN,
44
 
    bounce_info_stale_after TEXT,
45
 
    bounce_matching_headers TEXT,
46
 
    bounce_notify_owner_on_disable BOOLEAN,
47
 
    bounce_notify_owner_on_removal BOOLEAN,
48
 
    bounce_score_threshold INTEGER,
49
 
    bounce_you_are_disabled_warnings INTEGER,
50
 
    bounce_you_are_disabled_warnings_interval TEXT,
51
 
    -- Content filtering.
52
 
    filter_action INTEGER,
53
 
    filter_content BOOLEAN,
54
 
    collapse_alternatives BOOLEAN,
55
 
    convert_html_to_plaintext BOOLEAN,
56
 
    default_member_action INTEGER,
57
 
    default_nonmember_action INTEGER,
58
 
    description TEXT,
59
 
    digest_footer_uri TEXT,
60
 
    digest_header_uri TEXT,
61
 
    digest_is_default BOOLEAN,
62
 
    digest_send_periodic BOOLEAN,
63
 
    digest_size_threshold FLOAT,
64
 
    digest_volume_frequency INTEGER,
65
 
    digestable BOOLEAN,
66
 
    discard_these_nonmembers BLOB,
67
 
    emergency BOOLEAN,
68
 
    encode_ascii_prefixes BOOLEAN,
69
 
    first_strip_reply_to BOOLEAN,
70
 
    footer_uri TEXT,
71
 
    forward_auto_discards BOOLEAN,
72
 
    gateway_to_mail BOOLEAN,
73
 
    gateway_to_news BOOLEAN,
74
 
    goodbye_message_uri TEXT,
75
 
    header_matches BLOB,
76
 
    header_uri TEXT,
77
 
    hold_these_nonmembers BLOB,
78
 
    info TEXT,
79
 
    linked_newsgroup TEXT,
80
 
    max_days_to_hold INTEGER,
81
 
    max_message_size INTEGER,
82
 
    max_num_recipients INTEGER,
83
 
    member_moderation_notice TEXT,
84
 
    mime_is_default_digest BOOLEAN,
85
 
    moderator_password TEXT,
86
 
    new_member_options INTEGER,
87
 
    nondigestable BOOLEAN,
88
 
    nonmember_rejection_notice TEXT,
89
 
    obscure_addresses BOOLEAN,
90
 
    owner_chain TEXT,
91
 
    owner_pipeline TEXT,
92
 
    personalize INTEGER,
93
 
    post_id INTEGER,
94
 
    posting_chain TEXT,
95
 
    posting_pipeline TEXT,
96
 
    preferred_language TEXT,
97
 
    private_roster BOOLEAN,
98
 
    display_name TEXT,
99
 
    reject_these_nonmembers BLOB,
100
 
    reply_goes_to_list INTEGER,
101
 
    reply_to_address TEXT,
102
 
    require_explicit_destination BOOLEAN,
103
 
    respond_to_post_requests BOOLEAN,
104
 
    scrub_nondigest BOOLEAN,
105
 
    send_goodbye_message BOOLEAN,
106
 
    send_reminders BOOLEAN,
107
 
    send_welcome_message BOOLEAN,
108
 
    subject_prefix TEXT,
109
 
    subscribe_auto_approval BLOB,
110
 
    subscribe_policy INTEGER,
111
 
    topics BLOB,
112
 
    topics_bodylines_limit INTEGER,
113
 
    topics_enabled BOOLEAN,
114
 
    unsubscribe_policy INTEGER,
115
 
    welcome_message_uri TEXT,
116
 
    PRIMARY KEY (id)
117
 
    );
118
 
 
119
 
INSERT INTO mailinglist_backup SELECT
120
 
    id,
121
 
    -- List identity
122
 
    list_name,
123
 
    mail_host,
124
 
    include_list_post_header,
125
 
    include_rfc2369_headers,
126
 
    -- Attributes not directly modifiable via the web u/i
127
 
    created_at,
128
 
    admin_member_chunksize,
129
 
    next_request_id,
130
 
    next_digest_number,
131
 
    digest_last_sent_at,
132
 
    volume,
133
 
    last_post_at,
134
 
    accept_these_nonmembers,
135
 
    acceptable_aliases_id,
136
 
    admin_immed_notify,
137
 
    admin_notify_mchanges,
138
 
    administrivia,
139
 
    advertised,
140
 
    anonymous_list,
141
 
    -- Automatic responses.
142
 
    autorespond_owner,
143
 
    autoresponse_owner_text,
144
 
    autorespond_postings,
145
 
    autoresponse_postings_text,
146
 
    autorespond_requests,
147
 
    autoresponse_request_text,
148
 
    autoresponse_grace_period,
149
 
    -- Bounces.
150
 
    forward_unrecognized_bounces_to,
151
 
    process_bounces,
152
 
    bounce_info_stale_after,
153
 
    bounce_matching_headers,
154
 
    bounce_notify_owner_on_disable,
155
 
    bounce_notify_owner_on_removal,
156
 
    bounce_score_threshold,
157
 
    bounce_you_are_disabled_warnings,
158
 
    bounce_you_are_disabled_warnings_interval,
159
 
    -- Content filtering.
160
 
    filter_action,
161
 
    filter_content,
162
 
    collapse_alternatives,
163
 
    convert_html_to_plaintext,
164
 
    default_member_action,
165
 
    default_nonmember_action,
166
 
    description,
167
 
    digest_footer_uri,
168
 
    digest_header_uri,
169
 
    digest_is_default,
170
 
    digest_send_periodic,
171
 
    digest_size_threshold,
172
 
    digest_volume_frequency,
173
 
    digestable,
174
 
    discard_these_nonmembers,
175
 
    emergency,
176
 
    encode_ascii_prefixes,
177
 
    first_strip_reply_to,
178
 
    footer_uri,
179
 
    forward_auto_discards,
180
 
    gateway_to_mail,
181
 
    gateway_to_news,
182
 
    goodbye_message_uri,
183
 
    header_matches,
184
 
    header_uri,
185
 
    hold_these_nonmembers,
186
 
    info,
187
 
    linked_newsgroup,
188
 
    max_days_to_hold,
189
 
    max_message_size,
190
 
    max_num_recipients,
191
 
    member_moderation_notice,
192
 
    mime_is_default_digest,
193
 
    moderator_password,
194
 
    new_member_options,
195
 
    nondigestable,
196
 
    nonmember_rejection_notice,
197
 
    obscure_addresses,
198
 
    owner_chain,
199
 
    owner_pipeline,
200
 
    personalize,
201
 
    post_id,
202
 
    posting_chain,
203
 
    posting_pipeline,
204
 
    preferred_language,
205
 
    private_roster,
206
 
    display_name,
207
 
    reject_these_nonmembers,
208
 
    reply_goes_to_list,
209
 
    reply_to_address,
210
 
    require_explicit_destination,
211
 
    respond_to_post_requests,
212
 
    scrub_nondigest,
213
 
    send_goodbye_message,
214
 
    send_reminders,
215
 
    send_welcome_message,
216
 
    subject_prefix,
217
 
    subscribe_auto_approval,
218
 
    subscribe_policy,
219
 
    topics,
220
 
    topics_bodylines_limit,
221
 
    topics_enabled,
222
 
    unsubscribe_policy,
223
 
    welcome_message_uri
224
 
    FROM mailinglist;
225
 
 
226
 
CREATE TABLE member_backup(
227
 
    id INTEGER NOT NULL,
228
 
    _member_id TEXT,
229
 
    role INTEGER,
230
 
    moderation_action INTEGER,
231
 
    address_id INTEGER,
232
 
    preferences_id INTEGER,
233
 
    user_id INTEGER,
234
 
    PRIMARY KEY (id)
235
 
    );
236
 
 
237
 
INSERT INTO member_backup SELECT
238
 
    id,
239
 
    _member_id,
240
 
    role,
241
 
    moderation_action,
242
 
    address_id,
243
 
    preferences_id,
244
 
    user_id
245
 
    FROM member;
246
 
 
247
 
 
248
 
ALTER TABLE mailinglist_backup ADD COLUMN archive_policy INTEGER;
249
 
ALTER TABLE mailinglist_backup ADD COLUMN list_id TEXT;
250
 
ALTER TABLE mailinglist_backup ADD COLUMN nntp_prefix_subject_too INTEGER;
251
 
ALTER TABLE mailinglist_backup ADD COLUMN newsgroup_moderation INTEGER;
252
 
 
253
 
ALTER TABLE member_backup ADD COLUMN list_id TEXT;