aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Gareth Coles <[email protected]>2018-05-19 22:38:47 +0100
committerGravatar Gareth Coles <[email protected]>2018-05-19 22:38:47 +0100
commitbe6b907c3fe9e8948e1dde5440ea3e149314ba26 (patch)
treef0d7e387f61f69bb2c1745a6d2e256851abb404a
parentDon't escape form preamble (diff)
Catch index addition failure in oauth_data migration
-rw-r--r--pysite/migrations/tables/oauth_data/v1.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/pysite/migrations/tables/oauth_data/v1.py b/pysite/migrations/tables/oauth_data/v1.py
index 8448d8e5..dc7417bb 100644
--- a/pysite/migrations/tables/oauth_data/v1.py
+++ b/pysite/migrations/tables/oauth_data/v1.py
@@ -1,3 +1,9 @@
+from rethinkdb import ReqlOpFailedError
+
+
def run(db, table, table_obj):
- db.run(db.query(table).index_create("snowflake"))
- db.run(db.query(table).index_wait("snowflake"))
+ try:
+ db.run(db.query(table).index_create("snowflake"))
+ db.run(db.query(table).index_wait("snowflake"))
+ except ReqlOpFailedError:
+ print("Index already exists.")