Skip to content

Commit

Permalink
Import query data correctly for commit
Browse files Browse the repository at this point in the history
  • Loading branch information
richfitz committed Apr 26, 2019
1 parent f36631b commit 802342f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions R/db2.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
## namespace/module feature so that implementation details can be
## hidden away a bit further.

ORDERLY_SCHEMA_VERSION <- "0.0.6"
ORDERLY_SCHEMA_VERSION <- "0.0.7"

## These will be used in a few places and even though they're not
## super likely to change it would be good
Expand Down Expand Up @@ -319,7 +319,8 @@ report_data_import <- function(con, workdir, config) {
report_version_data <- data_frame(
report_version = id,
name = names(hash_data),
sql = unname(dat_in$data),
database = vcapply(dat_in$data, "[[", "database", USE.NAMES = FALSE),
query = vcapply(dat_in$data, "[[", "query", USE.NAMES = FALSE),
hash = unname(hash_data))
DBI::dbWriteTable(con, "report_version_data", report_version_data,
append = TRUE)
Expand Down
3 changes: 2 additions & 1 deletion inst/database/schema.yml
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,8 @@ report_version_data:
- id: {type: SERIAL}
- report_version: {fk: report_version.id}
- name: {type: TEXT}
- sql: {type: TEXT}
- database: {type: TEXT}
- query: {type: TEXT}
- hash: {fk: data.hash}

# What versions of packages were loaded?
Expand Down

0 comments on commit 802342f

Please sign in to comment.