Skip to content

Commit

Permalink
Remove string concatenation in spanner DB update (#4294)
Browse files Browse the repository at this point in the history
  • Loading branch information
c2thorn authored Dec 8, 2020
1 parent 257896e commit f407f63
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion templates/terraform/update_encoder/spanner_database.go.erb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ for i := len(oldDdls); i < len(newDdls); i++ {
updateDdls = append(updateDdls, newDdls[i].(string))
}

obj["statements"] = strings.Join(updateDdls, ",")
obj["statements"] = updateDdls
delete(obj, "name")
delete(obj, "instance")
delete(obj, "extraStatements")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ resource "google_spanner_database" "basic" {
"CREATE TABLE t1 (t1 INT64 NOT NULL,) PRIMARY KEY(t1)",
"CREATE TABLE t2 (t2 INT64 NOT NULL,) PRIMARY KEY(t2)",
"CREATE TABLE t3 (t3 INT64 NOT NULL,) PRIMARY KEY(t3)",
"CREATE TABLE t4 (t4 INT64 NOT NULL,) PRIMARY KEY(t4)",
]
deletion_protection = false
}
Expand Down

0 comments on commit f407f63

Please sign in to comment.