Skip to content

Commit

Permalink
Fix whitespace and add database to basic example.
Browse files Browse the repository at this point in the history
  • Loading branch information
pcostell committed May 5, 2023
1 parent 3a1fe8d commit 3d11bff
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 40 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
resource "google_firestore_field" "<%= ctx[:primary_resource_id] %>" {
project = "<%= ctx[:test_env_vars]['project_id'] %>"
database = "(default)"
collection = "chatrooms_%{random_suffix}"
field = "basic"

Expand Down
80 changes: 40 additions & 40 deletions mmv1/third_party/terraform/tests/resource_firestore_field_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,65 +71,65 @@ func testAccFirestoreField_runUpdateTest(updateConfig string, t *testing.T, cont
func testAccFirestoreField_firestoreFieldUpdateInitialExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_firestore_field" "%{resource_name}" {
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
}
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
}
}
`, context)
}

func testAccFirestoreField_firestoreFieldUpdateAddTTLExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_firestore_field" "%{resource_name}" {
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
}
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
}
ttl_config {}
ttl_config {}
}
`, context)
}

func testAccFirestoreField_firestoreFieldUpdateAddIndexExample(context map[string]interface{}) string {
return Nprintf(`
resource "google_firestore_field" "%{resource_name}" {
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
project = "%{project_id}"
collection = "chatrooms_%{random_suffix}"
field = "%{resource_name}"
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
indexes {
order = "DESCENDING"
query_scope = "COLLECTION_GROUP"
index_config {
indexes {
order = "ASCENDING"
query_scope = "COLLECTION_GROUP"
}
indexes {
array_config = "CONTAINS"
}
indexes {
order = "DESCENDING"
query_scope = "COLLECTION_GROUP"
}
}
}
}
`, context)
}

0 comments on commit 3d11bff

Please sign in to comment.