Skip to content

Commit

Permalink
No migrations reloading outside dev env
Browse files Browse the repository at this point in the history
  • Loading branch information
essenciary committed Oct 20, 2022
1 parent f8d9930 commit 253c070
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "SearchLight"
uuid = "340e8cb6-72eb-11e8-37ce-c97ebeb32050"
authors = ["Adrian Salceanu <e@essenciary.com>"]
version = "2.9.0"
version = "2.10.0"

[deps]
DataFrames = "a93c6f00-e57d-5684-b7b6-d8193f3e46c0"
Expand Down
7 changes: 6 additions & 1 deletion src/Migration.jl
Original file line number Diff line number Diff line change
Expand Up @@ -286,13 +286,18 @@ function run_migration(migration::DatabaseMigration, direction::Symbol; force =
end

try
m = Base.include(context, abspath(joinpath(SearchLight.config.db_migrations_folder, migration.migration_file_name)))::Module
m = if isdefined(context, Symbol(migration.migration_module_name)) && SearchLight.Configuration.env() != "dev" # always include in dev to pick up changes -- otherwise reuse
getfield(context, Symbol(migration.migration_module_name))
else
Base.include(context, 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"

return
end

Base.invokelatest(getfield(m, direction))

store_migration_status(migration, direction, force = force)
Expand Down

2 comments on commit 253c070

@essenciary
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/70680

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v2.10.0 -m "<description of version>" 253c0708b400b53469e33ac984a0b386afe486e0
git push origin v2.10.0

Please sign in to comment.