diff options
-rw-r--r-- | pysite/migrations/tables/oauth_data/v1.py | 10 |
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.") |