createk_data_migrator 0.1.1 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 99b4fed781f0d902d6405fae0316299baf15c356
4
- data.tar.gz: e54954cf3272cff56b956a694709cc23c02e89d9
2
+ SHA256:
3
+ metadata.gz: 3ac7519f6b579a6e5814ba18d0e5e6a6d5b8f5bea708d0d9aeb2a62dbaa31ec3
4
+ data.tar.gz: 0e63857818d773e11d28e2a1922b9574bed55c299a906442ba05ab0fb0b4e371
5
5
  SHA512:
6
- metadata.gz: 077aa2d2b7a6c5d83bfa3629c18012a55f5f4192dd54e83bcaa829b56051beb9be472fdbbc10133b6657c5bddc9a4d5ec97e275803953e5a1b6d34da1e53d1f7
7
- data.tar.gz: 58f5a649f4bf550c083697b7e21fb4a2f7d021f89c3b0459b0fb92bfad1f0638eb84ed72ff849b6271cf12a13c5e0f96f957532e53fc2d17986283bccaeefb20
6
+ metadata.gz: df3049f46eb8401d24eff27740fac6e8caa4f79ddbec7e9960b769132c3c4331f3894a220fcb1f5f0cb70fe71dde34754e9db6fb308a0673cd7ff2477925c3ca
7
+ data.tar.gz: f3355d1e5d7837513f01236f187e8fbaf0676969fae8fa4861f84e53aa9068c5b2a2385566386621f0468bae304694786b4acb931f00f18726c10a5901ea824b
data/README.md CHANGED
@@ -1,21 +1,21 @@
1
- # DataMigrator Useage
1
+ # CreatekDataMigrator Usage
2
2
 
3
- ## Installing DataMigrator
3
+ ## Installing CreatekDataMigrator
4
4
 
5
5
  Add the following to your Gemfile
6
6
 
7
- Add `data_migrator`
7
+ Add `createk_data_migrator`
8
8
 
9
9
  Then run `bundle install`
10
10
 
11
- Once DataMigrator is installed you will need to generate the `data_migrations`
11
+ Once CreatekDataMigrator is installed you will need to generate the `data_migrations`
12
12
  table that stores the versioning of data migrations.
13
13
 
14
- Run the following from the command line. `rails generate data_migrator`
14
+ Run the following from the command line. `rails generate createk_data_migrator`
15
15
 
16
16
  Then run `rake db:migrate`
17
17
 
18
- DataMigrator should now be installed & ready to be used
18
+ CreatekDataMigrator should now be installed & ready to be used
19
19
 
20
20
  ## Data Migration
21
21
 
@@ -8,9 +8,8 @@ Gem::Specification.new do |spec|
8
8
  spec.version = CreatekDataMigrator::VERSION
9
9
  spec.authors = ["Reiss Johnson"]
10
10
  spec.email = ["reissjohnson@me.com"]
11
-
12
11
  spec.summary = %q{A Gem used for creating data migration tasks}
13
-
12
+ spec.homepage = 'https://github.com/createkio/createk_data_migrator'
14
13
  spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
15
14
  spec.bindir = "exe"
16
15
  spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
@@ -1,3 +1,3 @@
1
1
  class CreatekDataMigrator
2
- VERSION = "0.1.1"
2
+ VERSION = "0.2.0"
3
3
  end
@@ -10,7 +10,11 @@ class CreatekDataMigrator
10
10
  old_paths = ActiveRecord::Tasks::DatabaseTasks.migrations_paths
11
11
  ActiveRecord::Tasks::DatabaseTasks.migrations_paths = [Rails.root.join('db/migrate_data')]
12
12
 
13
- ActiveRecord::Tasks::DatabaseTasks.migrate
13
+ if defined?(ActiveRecord::MigrationContext)
14
+ ActiveRecord::MigrationContext.new(ActiveRecord::Tasks::DatabaseTasks.migrations_paths).migrate
15
+ else
16
+ ActiveRecord::Tasks::DatabaseTasks.migrate
17
+ end
14
18
  ensure
15
19
  ActiveRecord::Tasks::DatabaseTasks.migrations_paths = old_paths
16
20
  end
@@ -5,12 +5,12 @@ namespace :db do
5
5
  namespace :data do
6
6
  task migrate: :environment do
7
7
  begin
8
- old_table_name = ActiveRecord::Base.schema_migrations_table_name
9
- ActiveRecord::Base.schema_migrations_table_name = 'data_migrations'
8
+ old_table_name = ActiveRecord::SchemaMigration.table_name
9
+ ActiveRecord::SchemaMigration.table_name = 'data_migrations'
10
10
 
11
11
  CreatekDataMigrator.migrate
12
12
  ensure
13
- ActiveRecord::Base.schema_migrations_table_name = old_table_name
13
+ ActiveRecord::SchemaMigration.table_name = old_table_name
14
14
  end
15
15
  end
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: createk_data_migrator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Reiss Johnson
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-13 00:00:00.000000000 Z
11
+ date: 2022-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -77,7 +77,7 @@ files:
77
77
  - lib/generators/templates/create_data_migrations_table.rb.tt
78
78
  - lib/tasks/data_migrate.rake
79
79
  - lib/templates/data_migration_template.rb.tt
80
- homepage:
80
+ homepage: https://github.com/createkio/createk_data_migrator
81
81
  licenses: []
82
82
  metadata: {}
83
83
  post_install_message:
@@ -95,8 +95,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
97
  requirements: []
98
- rubyforge_project:
99
- rubygems_version: 2.5.1
98
+ rubygems_version: 3.1.6
100
99
  signing_key:
101
100
  specification_version: 4
102
101
  summary: A Gem used for creating data migration tasks