db_create_new_schema.R 403 B

1234567891011121314
  1. # Loome uue schema
  2. db_create_new_schema <- function(conf) {
  3. source(paste0(getwd(), "/R/db_is_shema_exist.R"))
  4. if (!db_is_shema_exist(conf$schema)) {
  5. conn <- db_connect()
  6. DBI::dbExecute(conn, sprintf(
  7. "-- DROP SCHEMA x_matsalu;
  8. CREATE SCHEMA %s AUTHORIZATION %s;", conf$schema, conf$user
  9. ))
  10. }
  11. }
  12. # conf <- ruut::get_config()
  13. # conf$schema <- "x_valga"
  14. # db_create_new_schema(conf)