|
|
@@ -1,8 +1,15 @@
|
|
|
-# Loome uue schema
|
|
|
+#' Create the new schema
|
|
|
+#'
|
|
|
+#' Loome andmebaasi uue schema.
|
|
|
+#' @param conf list List of configuration data. Rewrite it.
|
|
|
+#' @keywords database, schema
|
|
|
+#' @export
|
|
|
+#' @examples
|
|
|
+#' config <- get_config()
|
|
|
+#' db_create_new_schema(conf = config)
|
|
|
db_create_new_schema <- function(conf) {
|
|
|
- source(paste0(getwd(), "/R/db_is_shema_exist.R"))
|
|
|
- if (!db_is_shema_exist(conf$schema)) {
|
|
|
- conn <- db_connect()
|
|
|
+ if (!ruut::db_is_shema_exist(conf$schema)) {
|
|
|
+ conn <- ruut::db_connect()
|
|
|
DBI::dbExecute(conn, sprintf(
|
|
|
"-- DROP SCHEMA x_matsalu;
|
|
|
CREATE SCHEMA %s AUTHORIZATION %s;", conf$schema, conf$user
|