Skip to content

Commit

Permalink
update test that used removed date field
Browse files Browse the repository at this point in the history
  • Loading branch information
infotroph committed Jul 9, 2024
1 parent 672958b commit 10e958d
Show file tree
Hide file tree
Showing 2 changed files with 73 additions and 6 deletions.
10 changes: 4 additions & 6 deletions base/settings/R/check.all.settings.R
Original file line number Diff line number Diff line change
Expand Up @@ -260,13 +260,11 @@ check.bety.version <- function(dbcon) {
}

# check if database is newer
last_migration_date <- lubridate::ymd_hms(utils::tail(versions, n = 1))
pecan_release_date <- lubridate::ymd(
utils::packageDescription("PEcAn.DB")$Date)
if (last_migration_date > pecan_release_date) {
unknown_migrations <- setdiff(versions, .known_bety_migrations)
if (any(unknown_migrations)) {
PEcAn.logger::logger.warn(
"Last database migration", utils::tail(versions, n = 1),
"is more recent than this", pecan_release_date, "release of PEcAn.",
"Found database migration(s) not known by this release of PEcAn.settings:",
unknown_migrations,
"This could result in PEcAn not working as expected.")
}
}
Expand Down
69 changes: 69 additions & 0 deletions base/settings/R/known_bety_migrations.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
# List of the entries in bety table `schema_migrations` that are known to this
# version of PEcAn.settings. If a live query returns entries not in this table,
# we may wish to warn about a potential mismatch between package and database.
#
# TODO: Would it make sense to move this, and the checks it supports, to PEcAn.DB?
.known_bety_migrations <- c(
"1",
"20130104205059",
"20130104211901",
"20130104211946",
"20130109205535",
"20130222222929",
"20130425152503",
"20130624001504",
"20130629205658",
"20130707190720",
"20130717162614",
"20130813212131",
"20130829162053",
"20150904184512",
"20130830184559",
"20140418005637",
"20140422155957",
"20140423220457",
"20140506210037",
"20140515205254",
"20140521180349",
"20140604192901",
"20140617163304",
"20140610210928",
"20140621060009",
"20140623004229",
"20140624185610",
"20140708232320",
"20140729045640",
"20151007174432",
"20151011190026",
"20140904220035",
"20140904221818",
"20140909212759",
"20140915153555",
"20141009160121",
"20141208165401",
"20141211220550",
"20150202215147",
"20150202220519",
"20150213162341",
"20150313165132",
"20150521211114",
"20150624220952",
"20150624222656",
"20150625184958",
"20151014182146",
"20160303221049",
"20160412030352",
"20160523165531",
"20160617133217",
"20160711231257",
"20160720182233",
"20160930213737",
"20161003180105",
"20161005181021",
"20161129192658",
"20170118205944",
"20170415183619",
"20170712171513",
"20180510184222",
"20181129000515",
"20200329233137")

0 comments on commit 10e958d

Please sign in to comment.