createk_data_migrator 0.1.2 → 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 +5 -5
- data/README.md +2 -2
- data/lib/createk_data_migrator/version.rb +1 -1
- data/lib/createk_data_migrator.rb +5 -1
- data/lib/tasks/data_migrate.rake +3 -3
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 3ac7519f6b579a6e5814ba18d0e5e6a6d5b8f5bea708d0d9aeb2a62dbaa31ec3
|
4
|
+
data.tar.gz: 0e63857818d773e11d28e2a1922b9574bed55c299a906442ba05ab0fb0b4e371
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: df3049f46eb8401d24eff27740fac6e8caa4f79ddbec7e9960b769132c3c4331f3894a220fcb1f5f0cb70fe71dde34754e9db6fb308a0673cd7ff2477925c3ca
|
7
|
+
data.tar.gz: f3355d1e5d7837513f01236f187e8fbaf0676969fae8fa4861f84e53aa9068c5b2a2385566386621f0468bae304694786b4acb931f00f18726c10a5901ea824b
|
data/README.md
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
# CreatekDataMigrator
|
1
|
+
# CreatekDataMigrator Usage
|
2
2
|
|
3
3
|
## Installing CreatekDataMigrator
|
4
4
|
|
@@ -11,7 +11,7 @@ Then run `bundle install`
|
|
11
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
|
14
|
+
Run the following from the command line. `rails generate createk_data_migrator`
|
15
15
|
|
16
16
|
Then run `rake db:migrate`
|
17
17
|
|
@@ -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::
|
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
|
data/lib/tasks/data_migrate.rake
CHANGED
@@ -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::
|
9
|
-
ActiveRecord::
|
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::
|
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.
|
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:
|
11
|
+
date: 2022-10-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -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
|
-
|
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
|