diff --git a/schema_manager.go b/schema_manager.go index 0238d488..359b6a59 100644 --- a/schema_manager.go +++ b/schema_manager.go @@ -126,10 +126,17 @@ func (mgr *SchemaManager) ApplyTag(tag LabelSchema) (*ResultSet, error) { if ttlCol != tag.TTLCol || ttlDuration != tag.TTLDuration { if mgr.verbose { - log.Printf("ApplyTag: Alter the tag TTL. name=%s, col=%s, duration=%d\n", tag.Name, ttlCol, ttlDuration) + log.Printf( + "ApplyTag: Alter the tag TTL. name=%s, col from %s to %s, duration from %d to %d\n", + tag.Name, + ttlCol, + tag.TTLCol, + ttlDuration, + tag.TTLDuration, + ) } - _, err = mgr.pool.AddTagTTL(tag.Name, ttlCol, ttlDuration) + _, err = mgr.pool.AddTagTTL(tag.Name, tag.TTLCol, tag.TTLDuration) if err != nil { return nil, err } @@ -236,10 +243,17 @@ func (mgr *SchemaManager) ApplyEdge(edge LabelSchema) (*ResultSet, error) { if ttlCol != edge.TTLCol || ttlDuration != edge.TTLDuration { if mgr.verbose { - log.Printf("ApplyEdge: Alter the edge TTL. name=%s, col=%s, duration=%d\n", edge.Name, ttlCol, ttlDuration) + log.Printf( + "ApplyEdge: Alter the edge TTL. name=%s, col from %s to %s, duration from %d to %d\n", + edge.Name, + ttlCol, + edge.TTLCol, + ttlDuration, + edge.TTLDuration, + ) } - _, err = mgr.pool.AddEdgeTTL(edge.Name, ttlCol, ttlDuration) + _, err = mgr.pool.AddEdgeTTL(edge.Name, edge.TTLCol, edge.TTLDuration) if err != nil { return nil, err } diff --git a/schema_manager_test.go b/schema_manager_test.go index 9effc656..b7ac4cf8 100644 --- a/schema_manager_test.go +++ b/schema_manager_test.go @@ -481,7 +481,7 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 2, len(labels)) + assert.Equal(t, 1, len(labels)) ttlCol, ttlDuration, err := sessionPool.GetEdgeTTL("friend") if err != nil { t.Fatal(err) @@ -500,7 +500,7 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 2, len(labels)) + assert.Equal(t, 1, len(labels)) ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL("friend") if err != nil { t.Fatal(err) @@ -520,7 +520,7 @@ func TestSchemaManagerApplyEdgeWithTTL(t *testing.T) { if err != nil { t.Fatal(err) } - assert.Equal(t, 2, len(labels)) + assert.Equal(t, 1, len(labels)) ttlCol, ttlDuration, err = sessionPool.GetEdgeTTL("friend") if err != nil { t.Fatal(err)