From 8a5a1191c9234dc39a62ef656fc09b5c33af70da Mon Sep 17 00:00:00 2001 From: Adrian Salceanu Date: Sun, 19 Jun 2022 18:38:25 +0200 Subject: [PATCH] Remove module replace warnings --- Project.toml | 2 +- src/Migration.jl | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/Project.toml b/Project.toml index e786bec..4129df5 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "SearchLight" uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050" authors = ["Adrian Salceanu "] -version = "2.4.0" +version = "2.4.1" [deps] DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0" diff --git a/src/Migration.jl b/src/Migration.jl index d709832..3f92343 100644 --- a/src/Migration.jl +++ b/src/Migration.jl @@ -283,7 +283,12 @@ function run_migration(migration::DatabaseMigration, direction::Symbol; force = end try - m = include(abspath(joinpath(SearchLight.config.db_migrations_folder, migration.migration_file_name)))::Module + m = if isdefined(@__MODULE__, Symbol(migration.migration_module_name)) + getfield(@__MODULE__, Symbol(migration.migration_module_name)) + else + include(abspath(joinpath(SearchLight.config.db_migrations_folder, migration.migration_file_name)))::Module + end + if in(:disabled, names(m, all = true)) && m.disabled && ! force @warn "Skipping, migration is disabled"