-
Notifications
You must be signed in to change notification settings - Fork 0
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
Upstream and allow engines #2
base: master
Are you sure you want to change the base?
Changes from all commits
9dda061
60fc88d
3743ddd
0a27cb0
04d3042
c00488a
6358268
88d4737
ee1e0d1
a0b638a
0285b50
19897f5
e13667b
e767299
c8bbac3
0351045
eb6da04
759a1f8
92891bb
10229cf
8aa2efd
b159001
3b15bdd
9aefda5
9d81103
73ce67b
3807de4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,7 +3,7 @@ name: Ruby Gem | |
on: | ||
push: | ||
branches: | ||
- master | ||
- main | ||
|
||
jobs: | ||
build: | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,4 +19,7 @@ | |
end | ||
|
||
module DataMigrate | ||
def self.root | ||
File.dirname(__FILE__) | ||
end | ||
end |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,10 +30,12 @@ def migrated | |
|
||
def versions | ||
@versions ||= begin | ||
versions = [] | ||
Dir.foreach(DataMigrate::DataMigrator.full_migrations_path) do |file| | ||
match_data = DataMigrate::DataMigrator.match(file) | ||
versions << match_data[1].to_i if match_data | ||
versions = Set.new | ||
DataMigrate::DataMigrator.migrations_paths.each do |path| | ||
Dir.foreach(path) do |file| | ||
match_data = DataMigrate::DataMigrator.match(file) | ||
versions << match_data[1].to_i if match_data | ||
end | ||
end | ||
versions | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,14 @@ | ||
module DataMigrate | ||
class DataSchemaMigration < ::ActiveRecord::SchemaMigration | ||
|
||
class DataSchemaMigration | ||
class << self | ||
def table_name | ||
ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix | ||
end | ||
delegate :table_name, :primary_key, :create_table, :normalized_versions, :create, :create!, :table_exists?, :exists?, :where, to: :instance | ||
|
||
def primary_key | ||
"version" | ||
def instance | ||
@instance ||= Class.new(::ActiveRecord::SchemaMigration) do | ||
define_singleton_method(:table_name) { ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix } | ||
define_singleton_method(:primary_key) { "version" } | ||
end | ||
end | ||
end | ||
end | ||
end | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module DataMigrate | ||
VERSION = "8.1.1".freeze | ||
VERSION = "8.5.0".freeze | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It looks like this might be changing the list from an expanded path to a relative path. It might be an issue if running the
data_migrate
command from somewhere other thanRails.root
? Pretty edge case, would not consider this a blocker for deployment, but maybe something the upstream folks will be concerned about 😸