From 082c88a4b22ded83607b40b080a0e862a3e34ed5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Tue, 24 Feb 2015 09:58:20 +0000 Subject: Update CHANGES and UPGRADE --- UPGRADE.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'UPGRADE.rst') diff --git a/UPGRADE.rst b/UPGRADE.rst index 6ea348acc3..4045baf4e0 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -1,3 +1,17 @@ +Upgrading to vx.xx +================== + +Servers which use captchas will need to add their public key to:: + + static/client/register/register_config.js + + window.matrixRegistrationConfig = { + recaptcha_public_key: "YOUR_PUBLIC_KEY" + }; + +This is required in order to support registration fallback (typically used on +mobile devices). + Upgrading to v0.7.0 =================== -- cgit 1.4.1 From c3c01641d2d49988c59826912e4e48740ab4f32a Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 2 Mar 2015 13:38:57 +0000 Subject: Run deltas and bump user_version in upgrade script --- UPGRADE.rst | 5 +++++ scripts/upgrade_appservice_db.py | 28 +++++++++++++++++++++++----- synapse/storage/__init__.py | 2 +- 3 files changed, 29 insertions(+), 6 deletions(-) (limited to 'UPGRADE.rst') diff --git a/UPGRADE.rst b/UPGRADE.rst index 4045baf4e0..8cda8d02a0 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -12,6 +12,11 @@ Servers which use captchas will need to add their public key to:: This is required in order to support registration fallback (typically used on mobile devices). +Servers which have registered application services need to upgrade their +database as the format of stored application services has changed in Synapse. +Run ``python upgrade_appservice_db.py `` to convert to the +new format. + Upgrading to v0.7.0 =================== diff --git a/scripts/upgrade_appservice_db.py b/scripts/upgrade_appservice_db.py index acdee56d9f..ae1b91c64f 100644 --- a/scripts/upgrade_appservice_db.py +++ b/scripts/upgrade_appservice_db.py @@ -1,17 +1,28 @@ +from synapse.storage import read_schema import argparse import json import sqlite3 -def main(dbname): - con = sqlite3.connect(dbname) - cur = con.cursor() +def do_other_deltas(cursor): + cursor.execute("PRAGMA user_version") + row = cursor.fetchone() + + if row and row[0]: + user_version = row[0] + # Run every version since after the current version. + for v in range(user_version + 1, 10): + print "Running delta: %d" % (v,) + sql_script = read_schema("delta/v%d" % (v,)) + cursor.executescript(sql_script) + + +def update_app_service_table(cur): cur.execute("SELECT id, regex FROM application_services_regex") for row in cur.fetchall(): try: print "checking %s..." % row[0] json.loads(row[1]) - print "Already in new format" except ValueError: # row isn't in json, make it so. string_regex = row[1] @@ -23,13 +34,20 @@ def main(dbname): "UPDATE application_services_regex SET regex=? WHERE id=?", (new_regex, row[0]) ) + + +def main(dbname): + con = sqlite3.connect(dbname) + cur = con.cursor() + do_other_deltas(cur) + update_app_service_table(cur) + cur.execute("PRAGMA user_version = 14") cur.close() con.commit() if __name__ == "__main__": parser = argparse.ArgumentParser() - parser.add_argument("database") args = parser.parse_args() diff --git a/synapse/storage/__init__.py b/synapse/storage/__init__.py index d16e7b8fac..3753cd28d0 100644 --- a/synapse/storage/__init__.py +++ b/synapse/storage/__init__.py @@ -74,7 +74,7 @@ SCHEMAS = [ # Remember to update this number every time an incompatible change is made to # database schema files, so the users will be informed on server restarts. -SCHEMA_VERSION = 13 +SCHEMA_VERSION = 14 dir_path = os.path.abspath(os.path.dirname(__file__)) -- cgit 1.4.1 From fb7b6c468128033fcaec3c3e4ca678e5cd3694a0 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Mon, 2 Mar 2015 14:52:31 +0000 Subject: Wording tweaks --- UPGRADE.rst | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'UPGRADE.rst') diff --git a/UPGRADE.rst b/UPGRADE.rst index 8cda8d02a0..f2a042f0e9 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -12,10 +12,9 @@ Servers which use captchas will need to add their public key to:: This is required in order to support registration fallback (typically used on mobile devices). -Servers which have registered application services need to upgrade their -database as the format of stored application services has changed in Synapse. -Run ``python upgrade_appservice_db.py `` to convert to the -new format. +The format of stored application services has changed in Synapse. You will need +to run ``python upgrade_appservice_db.py `` to convert to +the new format. Upgrading to v0.7.0 =================== -- cgit 1.4.1 From 3c8bd7809c1f8739c5b8676d8966fa19851a4e9a Mon Sep 17 00:00:00 2001 From: David Baker Date: Mon, 2 Mar 2015 16:40:17 +0000 Subject: Fix upgrade instructions --- UPGRADE.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'UPGRADE.rst') diff --git a/UPGRADE.rst b/UPGRADE.rst index f2a042f0e9..499b59aa0a 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -13,8 +13,8 @@ This is required in order to support registration fallback (typically used on mobile devices). The format of stored application services has changed in Synapse. You will need -to run ``python upgrade_appservice_db.py `` to convert to -the new format. +to run ``PYTHONPATH=. python scripts/upgrade_appservice_db.py `` +to convert to the new format. Upgrading to v0.7.0 =================== -- cgit 1.4.1 From 2763587acdaaa5e75f050de2e11f323f5319b57a Mon Sep 17 00:00:00 2001 From: Erik Johnston Date: Fri, 6 Mar 2015 14:37:16 +0000 Subject: Update UPGRADES.rst --- UPGRADE.rst | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'UPGRADE.rst') diff --git a/UPGRADE.rst b/UPGRADE.rst index 499b59aa0a..87dd6e04a8 100644 --- a/UPGRADE.rst +++ b/UPGRADE.rst @@ -1,5 +1,5 @@ -Upgrading to vx.xx -================== +Upgrading to v0.8.0 +=================== Servers which use captchas will need to add their public key to:: @@ -12,9 +12,6 @@ Servers which use captchas will need to add their public key to:: This is required in order to support registration fallback (typically used on mobile devices). -The format of stored application services has changed in Synapse. You will need -to run ``PYTHONPATH=. python scripts/upgrade_appservice_db.py `` -to convert to the new format. Upgrading to v0.7.0 =================== -- cgit 1.4.1