Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

allow directory nested data migration file paths #193

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/data_migrate/data_schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def migrated
def versions
@versions ||= begin
versions = []
Dir.foreach(DataMigrate::DataMigrator.full_migrations_path) do |file|
Dir.glob(File.join(DataMigrate::DataMigrator.full_migrations_path, '**', '*.rb')) do |file|
match_data = DataMigrate::DataMigrator.match(file)
versions << match_data[1].to_i if match_data
end
Expand Down
2 changes: 1 addition & 1 deletion lib/data_migrate/status_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def migration_list(db_list)

def migration_files(db_list)
file_list = []
Dir.foreach(File.join(root_folder, DataMigrate.config.data_migrations_path)) do |file|
Dir.glob(File.join(root_folder, DataMigrate.config.data_migrations_path, '**', '*.rb')) do |file|
# only files matching "20091231235959_some_name.rb" pattern
if match_data = DataMigrate::DataMigrator.match(file)
status = db_list.delete(match_data[1]) ? "up" : "down"
Expand Down