We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent ab85e46 commit bd24050Copy full SHA for bd24050
redis_developer/model/migrations/migrator.py
@@ -44,6 +44,11 @@ def schema_hash_key(index_name):
44
45
46
def create_index(index_name, schema, current_hash):
47
+ try:
48
+ redis.execute_command(f"ft.info {index_name}")
49
+ except ResponseError:
50
+ log.info("Index already exists, skipping. Index hash: %s", index_name)
51
+ return
52
redis.execute_command(f"ft.create {index_name} {schema}")
53
redis.set(schema_hash_key(index_name), current_hash)
54
0 commit comments