nicolask has proposed merging lp:~nkarageuzian/mailman/pg_update into 
lp:mailman.

Requested reviews:
  Mailman Coders (mailman-coders)

For more details, see:
https://code.launchpad.net/~nkarageuzian/mailman/pg_update/+merge/197519

Added postgreSQL schema upgrade scripts
-- 
https://code.launchpad.net/~nkarageuzian/mailman/pg_update/+merge/197519
Your team Mailman Coders is requested to review the proposed merge of 
lp:~nkarageuzian/mailman/pg_update into lp:mailman.
=== added file 'src/mailman/database/schema/mm_20131007000000.py'
--- src/mailman/database/schema/mm_20131007000000.py	1970-01-01 00:00:00 +0000
+++ src/mailman/database/schema/mm_20131007000000.py	2013-12-03 13:14:47 +0000
@@ -0,0 +1,45 @@
+# Copyright (C) 2012-2013 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
+
+"""3.0b3 -> 3.0b4 schema migrations.
+
+Type changes:
+ * mailinglist.moderator_password: TEXT -> BYTEA
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+    'upgrade',
+    ]
+
+
+VERSION = '20131007000000'
+
+
+
+def upgrade(database, store, version, module_path):
+    if database.TAG == 'sqlite':
+        return
+    store.execute("""
+        ALTER TABLE mailinglist ALTER COLUMN moderator_password TYPE BYTEA
+            USING convert_to(moderator_password, 'SQL_ASCII');
+    """)
+    # Record the migration in the version table.
+    database.load_schema(store, version, None, module_path)
+

=== added file 'src/mailman/database/schema/mm_20131203000000.py'
--- src/mailman/database/schema/mm_20131203000000.py	1970-01-01 00:00:00 +0000
+++ src/mailman/database/schema/mm_20131203000000.py	2013-12-03 13:14:47 +0000
@@ -0,0 +1,75 @@
+# Copyright (C) 2012-2013 by the Free Software Foundation, Inc.
+#
+# This file is part of GNU Mailman.
+#
+# GNU Mailman is free software: you can redistribute it and/or modify it under
+# the terms of the GNU General Public License as published by the Free
+# Software Foundation, either version 3 of the License, or (at your option)
+# any later version.
+#
+# GNU Mailman is distributed in the hope that it will be useful, but WITHOUT
+# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+# FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License for
+# more details.
+#
+# You should have received a copy of the GNU General Public License along with
+# GNU Mailman.  If not, see <http://www.gnu.org/licenses/>.
+
+"""3.0b3 -> 3.0b4 schema migrations.
+
+Type changes:
+ * bounceevent.list_id (NEW COLUMN)
+ * per list archiver (NEW TABLE)
+"""
+
+from __future__ import absolute_import, print_function, unicode_literals
+
+__metaclass__ = type
+__all__ = [
+    'upgrade',
+    ]
+
+
+VERSION = '20131007000000'
+
+
+
+def upgrade(database, store, version, module_path):
+    if database.TAG == 'sqlite':
+        return
+    store.execute("""
+CREATE TABLE bounceevent_backup (
+    id SERIAL NOT NULL,
+    email TEXT,
+    "timestamp" TIMESTAMP,
+    message_id TEXT,
+    context INTEGER,
+    processed BOOLEAN,
+    PRIMARY KEY (id)
+    );
+    """)
+    store.execute("""
+INSERT INTO bounceevent_backup SELECT
+    id, email, "timestamp", message_id,
+    context, processed
+    FROM bounceevent;
+    """)
+    store.execute("""
+ALTER TABLE bounceevent_backup ADD COLUMN list_id TEXT;
+    """)
+    store.execute("""
+CREATE TABLE listarchiver (
+    id SERIAL NOT NULL,
+    mailing_list_id INTEGER NOT NULL,
+    name TEXT NOT NULL,
+    _is_enabled BOOLEAN,
+    PRIMARY KEY (id)
+    );
+    """)
+    store.execute("""
+CREATE INDEX ix_listarchiver_mailing_list_id
+    ON listarchiver(mailing_list_id);
+    """)
+    # Record the migration in the version table.
+    database.load_schema(store, version, None, module_path)
+

_______________________________________________
Mailman-coders mailing list
[email protected]
https://mail.python.org/mailman/listinfo/mailman-coders

Reply via email to