Skip to content

Commit

Permalink
allow directory nested data migration file paths
Browse files Browse the repository at this point in the history
nested data migration files are taken into account with data migrate
but not when loading current schema
  • Loading branch information
vincentjoseph committed Jun 13, 2021
1 parent 8a99cea commit 8ce5f1b
Show file tree
Hide file tree
Showing 6 changed files with 2 additions and 2 deletions.
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.config.data_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
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 comments on commit 8ce5f1b

Please sign in to comment.