data_migration_for_rails 0.1.2 → 0.1.3
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 +4 -4
- data/lib/data_migration/engine.rb +4 -9
- data/lib/data_migration/version.rb +1 -1
- data/lib/data_migration_for_rails.rb +3 -0
- data/lib/tasks/data_migration_tasks.rake +24 -0
- metadata +2 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 4cfb5ac35d2961f41dff545c01c02d8ece214205ef3081d6b0c6a5df6850006e
|
|
4
|
+
data.tar.gz: 0232f9a2313abea779ffcec43300eaf4e352c11b9b29c73cef997d83993ed2eb
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d2b2c3be6054683d7b62c7a9779f38dde0c30e31d82f92d9df1623eb52d415c24d2236acddda395565be90433c73a7decb6a705b65051920d4ad15b944d63380
|
|
7
|
+
data.tar.gz: 80a56ab498446a6ab927509e0abe40cadf4b2b8399194aedbda7bbe60c792a1fb421008fe20d144ba3bda736988414762f6e34a02eaaf0350199ecd2b01df575
|
|
@@ -10,15 +10,6 @@ module DataMigration
|
|
|
10
10
|
# Mountable engine - does NOT use isolate_namespace
|
|
11
11
|
# This allows the engine to integrate with the host app's models
|
|
12
12
|
|
|
13
|
-
# Expose engine migrations to the host app
|
|
14
|
-
initializer 'data_migration.migrations' do |app|
|
|
15
|
-
unless app.root.to_s == root.to_s
|
|
16
|
-
config.paths['db/migrate'].expanded.each do |path|
|
|
17
|
-
app.config.paths['db/migrate'] << path
|
|
18
|
-
end
|
|
19
|
-
end
|
|
20
|
-
end
|
|
21
|
-
|
|
22
13
|
# Ensure engine's app directories are autoloaded
|
|
23
14
|
config.autoload_paths += %W[
|
|
24
15
|
#{config.root}/app/controllers
|
|
@@ -33,5 +24,9 @@ module DataMigration
|
|
|
33
24
|
g.fixture_replacement :factory_bot
|
|
34
25
|
g.factory_bot dir: 'spec/factories'
|
|
35
26
|
end
|
|
27
|
+
|
|
28
|
+
rake_tasks do
|
|
29
|
+
Dir[root.join('lib/tasks/**/*.rake')].each { |f| load f }
|
|
30
|
+
end
|
|
36
31
|
end
|
|
37
32
|
end
|
|
@@ -1,5 +1,29 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
namespace :data_migration_engine do
|
|
4
|
+
namespace :install do
|
|
5
|
+
desc 'Copy migrations from data_migration_for_rails to application'
|
|
6
|
+
task :migrations do
|
|
7
|
+
source = DataMigration::Engine.root.join('db', 'migrate')
|
|
8
|
+
destination = Pathname.new(Rails.root).join('db', 'migrate')
|
|
9
|
+
|
|
10
|
+
FileUtils.mkdir_p(destination)
|
|
11
|
+
|
|
12
|
+
Dir.glob(source.join('*.rb')).sort.each do |file|
|
|
13
|
+
filename = File.basename(file)
|
|
14
|
+
dest_file = destination.join(filename)
|
|
15
|
+
|
|
16
|
+
if dest_file.exist?
|
|
17
|
+
puts " [skip] db/migrate/#{filename}"
|
|
18
|
+
else
|
|
19
|
+
FileUtils.cp(file, dest_file)
|
|
20
|
+
puts " [copy] db/migrate/#{filename}"
|
|
21
|
+
end
|
|
22
|
+
end
|
|
23
|
+
end
|
|
24
|
+
end
|
|
25
|
+
end
|
|
26
|
+
|
|
3
27
|
namespace :data_migration do
|
|
4
28
|
desc 'Install Data Migration engine (migrations + seed admin user)'
|
|
5
29
|
task install: :environment do
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: data_migration_for_rails
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.1.
|
|
4
|
+
version: 0.1.3
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Vaibhav Rokkam
|
|
@@ -267,6 +267,7 @@ files:
|
|
|
267
267
|
- lib/data_migration.rb
|
|
268
268
|
- lib/data_migration/engine.rb
|
|
269
269
|
- lib/data_migration/version.rb
|
|
270
|
+
- lib/data_migration_for_rails.rb
|
|
270
271
|
- lib/tasks/data_migration_tasks.rake
|
|
271
272
|
homepage: https://github.com/rokkamv/data_migration_for_rails
|
|
272
273
|
licenses:
|