diff --git a/migrations/45_create_elastic_index_messages.go b/migrations/45_create_elastic_index_messages.go index bf04510d..af05520f 100644 --- a/migrations/45_create_elastic_index_messages.go +++ b/migrations/45_create_elastic_index_messages.go @@ -12,7 +12,7 @@ func m45_create_elastic_index_messages() { } elastic := cache.GetElastic() - exists, err := elastic.IndexExists("robyul-messages").Do(context.Background()) + exists, err := elastic.IndexExists("robyul-messages-v2").Do(context.Background()) if err != nil { panic(err) } @@ -67,7 +67,7 @@ func m45_create_elastic_index_messages() { }, } - index, err := elastic.CreateIndex("robyul-messages").BodyJson(messageMapping).Do(context.Background()) + index, err := elastic.CreateIndex("robyul-messages-v2").BodyJson(messageMapping).Do(context.Background()) if err != nil { panic(err) } diff --git a/migrations/51_reindex_elasticv5_to_v6.go b/migrations/51_reindex_elasticv5_to_v6.go index 99e35836..aad3402c 100644 --- a/migrations/51_reindex_elasticv5_to_v6.go +++ b/migrations/51_reindex_elasticv5_to_v6.go @@ -24,7 +24,7 @@ func m51_reindex_elasticv5_to_v6() { cache.GetLogger().WithField("module", "migrations").Info("reindexing ElasticSearch indexes") src := elastic.NewReindexSource().Index("robyul").Type("message") - dst := elastic.NewReindexDestination().Index("robyul-messages").Type("doc") + dst := elastic.NewReindexDestination().Index("robyul-messages-v2").Type("doc") res, err := elasticClient.Reindex().Source(src).Destination(dst).Refresh("true").Do(context.Background()) if err != nil { panic(err) diff --git a/models/elastic.go b/models/elastic.go index a4c79f91..e74fda64 100644 --- a/models/elastic.go +++ b/models/elastic.go @@ -3,7 +3,7 @@ package models import "time" const ( - ElasticIndexMessages = "robyul-messages" + ElasticIndexMessages = "robyul-messages-v2" ElasticIndexJoins = "robyul-joins" ElasticIndexLeaves = "robyul-leaves" ElasticIndexPresenceUpdates = "robyul-presence_updates"