diff options
| author | 2018-05-19 22:38:47 +0100 | |
|---|---|---|
| committer | 2018-05-19 22:38:47 +0100 | |
| commit | be6b907c3fe9e8948e1dde5440ea3e149314ba26 (patch) | |
| tree | f0d7e387f61f69bb2c1745a6d2e256851abb404a /pysite/migrations | |
| parent | Don't escape form preamble (diff) | |
Catch index addition failure in oauth_data migration
Diffstat (limited to 'pysite/migrations')
| -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.") | 
