data_migrate 6.8.0 → 7.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -3
- data/Changelog.md +8 -1
- data/Gemfile +6 -1
- data/Gemfile.rails5 +6 -1
- data/Gemfile.rails5.1 +6 -1
- data/Gemfile.rails5.2 +6 -1
- data/Gemfile.rails6.1 +6 -1
- data/data_migrate.gemspec +7 -1
- data/lib/data_migrate/schema_dumper.rb +0 -4
- data/lib/data_migrate/version.rb +1 -1
- data/lib/generators/data_migration/templates/data_migration.rb +2 -0
- data/spec/db/data/partial_schema/data_schema.rb +0 -1
- data/spec/db/data/partial_schema/test_data_schema.rb +0 -1
- data/spec/db/data/schema/data_schema.rb +0 -1
- data/spec/db/data/schema/test_data_schema.rb +0 -1
- data/tasks/databases.rake +18 -32
- metadata +17 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d029ae70dba905ed85200561697e4e44b62b654ab216d6b20b809737e35f3fc1
|
4
|
+
data.tar.gz: 39f53a2d2f289d8d55730f9657bbaef454abff395593e354fa31ef11b1a38dd3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b0e7f347d47d48acab66cb3e700f72321805ee29fbed1bbb7689bfaafb0f7cff6a0add4a62ec847cb0d49dd18b46f9408b3b8d3a2bf56c0fa1c2a75dcabb3277
|
7
|
+
data.tar.gz: 63a062d5266920ecddd9d18a781f9105390f9188cc9ed6cc4930a99821ab2ed972dae7cb2687de9202c0a26fcf29040eb77aae78215e43401d234685116a7981
|
data/.travis.yml
CHANGED
data/Changelog.md
CHANGED
@@ -1,9 +1,16 @@
|
|
1
1
|
# Changelog
|
2
2
|
|
3
|
+
## 7.0.2
|
4
|
+
|
5
|
+
Remove magic comment in migration files [y-yagi](https://github.com/y-yagi)
|
6
|
+
User frozen string [jonnay](https://github.com/jonnay)
|
7
|
+
## 7.0.1
|
8
|
+
Use SchemaMigration.migrations_paths in main rake task [lewhit](https://github.com/lewhit)
|
9
|
+
|
3
10
|
## 6.8.0
|
4
11
|
|
5
12
|
Specify database name for migrations_paths [lewhit](https://github.com/lewhit)
|
6
|
-
|
13
|
+
## 6.7.0
|
7
14
|
|
8
15
|
Add configuration for which database name is to be used for database migrations [lewhit](https://github.com/lewhit)
|
9
16
|
Add tests for Rails 6.1 [lewhit](https://github.com/lewhit)
|
data/Gemfile
CHANGED
data/Gemfile.rails5
CHANGED
data/Gemfile.rails5.1
CHANGED
data/Gemfile.rails5.2
CHANGED
data/Gemfile.rails6.1
CHANGED
data/data_migrate.gemspec
CHANGED
@@ -15,7 +15,13 @@ Gem::Specification.new do |s|
|
|
15
15
|
|
16
16
|
s.rubyforge_project = "data_migrate"
|
17
17
|
|
18
|
-
|
18
|
+
%w[
|
19
|
+
activerecord
|
20
|
+
railties
|
21
|
+
].each do |rails_gem|
|
22
|
+
s.add_dependency(rails_gem, '>= 5.0')
|
23
|
+
end
|
24
|
+
|
19
25
|
s.add_development_dependency "appraisal"
|
20
26
|
s.add_development_dependency "rake"
|
21
27
|
s.add_development_dependency "rspec"
|
@@ -17,10 +17,6 @@ module DataMigrate
|
|
17
17
|
def dump(stream)
|
18
18
|
define_params = @version ? "version: #{@version}" : ""
|
19
19
|
|
20
|
-
if stream.respond_to?(:external_encoding) && stream.external_encoding
|
21
|
-
stream.puts "# encoding: #{stream.external_encoding.name}"
|
22
|
-
end
|
23
|
-
|
24
20
|
stream.puts "DataMigrate::Data.define(#{define_params})"
|
25
21
|
|
26
22
|
stream
|
data/lib/data_migrate/version.rb
CHANGED
data/tasks/databases.rake
CHANGED
@@ -46,17 +46,7 @@ namespace :db do
|
|
46
46
|
end
|
47
47
|
|
48
48
|
migrations.each do |migration|
|
49
|
-
|
50
|
-
ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71])
|
51
|
-
DataMigrate::DataMigrator.run(migration[:direction], data_migrations_path, migration[:version])
|
52
|
-
else
|
53
|
-
ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69])
|
54
|
-
DataMigrate::SchemaMigration.run(
|
55
|
-
migration[:direction],
|
56
|
-
Rails.application.config.paths["db/migrate"],
|
57
|
-
migration[:version]
|
58
|
-
)
|
59
|
-
end
|
49
|
+
run_migration(migration, migration[:direction])
|
60
50
|
end
|
61
51
|
|
62
52
|
Rake::Task["db:_dump"].invoke
|
@@ -91,13 +81,7 @@ namespace :db do
|
|
91
81
|
end
|
92
82
|
|
93
83
|
migrations.each do |migration|
|
94
|
-
|
95
|
-
ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71])
|
96
|
-
DataMigrate::DataMigrator.run(:up, data_migrations_path, migration[:version])
|
97
|
-
else
|
98
|
-
ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69])
|
99
|
-
DataMigrate::SchemaMigration.run(:up, "db/migrate/", migration[:version])
|
100
|
-
end
|
84
|
+
run_migration(migration, :up)
|
101
85
|
end
|
102
86
|
|
103
87
|
Rake::Task["db:_dump"].invoke
|
@@ -119,13 +103,7 @@ namespace :db do
|
|
119
103
|
end
|
120
104
|
|
121
105
|
migrations.each do |migration|
|
122
|
-
|
123
|
-
ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71])
|
124
|
-
DataMigrate::DataMigrator.run(:down, data_migrations_path, migration[:version])
|
125
|
-
else
|
126
|
-
ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69])
|
127
|
-
DataMigrate::SchemaMigration.run(:down, "db/migrate/", migration[:version])
|
128
|
-
end
|
106
|
+
run_migration(migration, :down)
|
129
107
|
end
|
130
108
|
|
131
109
|
Rake::Task["db:_dump"].invoke
|
@@ -189,13 +167,7 @@ namespace :db do
|
|
189
167
|
step = ENV['STEP'] ? ENV['STEP'].to_i : 1
|
190
168
|
assure_data_schema_table
|
191
169
|
past_migrations[0..(step - 1)].each do | past_migration |
|
192
|
-
|
193
|
-
ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71])
|
194
|
-
DataMigrate::DataMigrator.run(:down, data_migrations_path, past_migration[:version])
|
195
|
-
elsif past_migration[:kind] == :schema
|
196
|
-
ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69])
|
197
|
-
DataMigrate::SchemaMigration.run(:down, "db/migrate/", past_migration[:version])
|
198
|
-
end
|
170
|
+
run_migration(past_migration, :down)
|
199
171
|
end
|
200
172
|
|
201
173
|
Rake::Task["db:_dump"].invoke
|
@@ -412,3 +384,17 @@ end
|
|
412
384
|
def data_migrations_path
|
413
385
|
DataMigrate.config.data_migrations_path
|
414
386
|
end
|
387
|
+
|
388
|
+
def run_migration(migration, direction)
|
389
|
+
if migration[:kind] == :data
|
390
|
+
ActiveRecord::Migration.write("== %s %s" % ['Data', "=" * 71])
|
391
|
+
DataMigrate::DataMigrator.run(direction, data_migrations_path, migration[:version])
|
392
|
+
else
|
393
|
+
ActiveRecord::Migration.write("== %s %s" % ['Schema', "=" * 69])
|
394
|
+
DataMigrate::SchemaMigration.run(
|
395
|
+
direction,
|
396
|
+
DataMigrate::SchemaMigration.migrations_paths,
|
397
|
+
migration[:version]
|
398
|
+
)
|
399
|
+
end
|
400
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_migrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 7.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew J Vargo
|
@@ -10,10 +10,24 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2021-
|
13
|
+
date: 2021-07-12 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
|
-
name:
|
16
|
+
name: activerecord
|
17
|
+
requirement: !ruby/object:Gem::Requirement
|
18
|
+
requirements:
|
19
|
+
- - ">="
|
20
|
+
- !ruby/object:Gem::Version
|
21
|
+
version: '5.0'
|
22
|
+
type: :runtime
|
23
|
+
prerelease: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
version: '5.0'
|
29
|
+
- !ruby/object:Gem::Dependency
|
30
|
+
name: railties
|
17
31
|
requirement: !ruby/object:Gem::Requirement
|
18
32
|
requirements:
|
19
33
|
- - ">="
|