Skip to contents

Given a name and an ID for that facility in the facilities_attributes table, insert a new record into the names table.

Usage

insert_name(
  new_name = NULL,
  role = c("alternate", "primary"),
  facilities_attributes_id = NULL,
  test_db = FALSE
)

Arguments

new_name

The name of the facility that is being added.

role

Is this an alternate name for the facility, or its primary name? Defaults to alternate.

facilities_attributes_id

The matching ID in the facilities_attributes table for the facility whose name is being supplied.

test_db

Is this connection to the test database (TRUE) or not (FALSE)? Defaults to FALSE.

Value

A tibble with one row containing the newly-added record.

Examples

insert_name(
    new_name = "Hobbiton Hall",
    facilities_attributes_id = "FA174",
    test_db = TRUE
)
#>    id         value      role facilities_attributes_id
#> 1 682 Hobbiton Hall alternate                    FA174