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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 3f0dd24ff404906327e5bc24b17a503f0f3b83216822d6b30ea23c36f003ac91
4
- data.tar.gz: 53b774e131bc3f0fc4267b4cc1b46df6f9cefed04064f6d32fae6adf17193539
3
+ metadata.gz: d029ae70dba905ed85200561697e4e44b62b654ab216d6b20b809737e35f3fc1
4
+ data.tar.gz: 39f53a2d2f289d8d55730f9657bbaef454abff395593e354fa31ef11b1a38dd3
5
5
  SHA512:
6
- metadata.gz: 96d703eb0eb1af977f911200287a7b47c4defc186e346ebeff842c2d79d098c9bf2bb7c99b618b140a1b72a8e9f67ad047ef022eaff7b5e55f9ad54c1beb3662
7
- data.tar.gz: 0c313639ecf58bc5573cdeab9bc3ae2d2c8aa2f443aacf95f03f0951ab708e79247d05bc647c28ae293ee7f9b5eb246bb8e18fd7e5fc5a5c24d700da84524c1b
6
+ metadata.gz: b0e7f347d47d48acab66cb3e700f72321805ee29fbed1bbb7689bfaafb0f7cff6a0add4a62ec847cb0d49dd18b46f9408b3b8d3a2bf56c0fa1c2a75dcabb3277
7
+ data.tar.gz: 63a062d5266920ecddd9d18a781f9105390f9188cc9ed6cc4930a99821ab2ed972dae7cb2687de9202c0a26fcf29040eb77aae78215e43401d234685116a7981
data/.travis.yml CHANGED
@@ -1,8 +1,7 @@
1
1
  language: ruby
2
2
  rvm:
3
- - 2.4.4
4
- - 2.5.5
5
- - 2.6.2
3
+ - 2.6
4
+ - 2.7
6
5
  script: bundle exec rspec
7
6
  gemfile:
8
7
  - gemfiles/rails_5.1.gemfile
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
- # 6.7.0
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
@@ -1,6 +1,11 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in data_migrate.gemspec
4
- gem 'rails', '~> 6.0.0'
4
+ %w[
5
+ activerecord
6
+ railties
7
+ ].each do |rails_gem|
8
+ gem rails_gem, '~> 6.0.0'
9
+ end
5
10
  gem 'sqlite3', "~> 1.4"
6
11
  gemspec
data/Gemfile.rails5 CHANGED
@@ -2,4 +2,9 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in data_migrate.gemspec
4
4
  gemspec
5
- gem 'rails', '~> 5.0.0'
5
+ %w[
6
+ activerecord
7
+ railties
8
+ ].each do |rails_gem|
9
+ gem rails_gem, '~> 5.0.0'
10
+ end
data/Gemfile.rails5.1 CHANGED
@@ -2,4 +2,9 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in data_migrate.gemspec
4
4
  gemspec
5
- gem 'rails', '~> 5.1.7'
5
+ %w[
6
+ activerecord
7
+ railties
8
+ ].each do |rails_gem|
9
+ gem rails_gem, '~> 5.1.7'
10
+ end
data/Gemfile.rails5.2 CHANGED
@@ -2,4 +2,9 @@ source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in data_migrate.gemspec
4
4
  gemspec
5
- gem 'rails', '~> 5.2'
5
+ %w[
6
+ activerecord
7
+ railties
8
+ ].each do |rails_gem|
9
+ gem rails_gem, '~> 5.2'
10
+ end
data/Gemfile.rails6.1 CHANGED
@@ -1,6 +1,11 @@
1
1
  source "http://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in data_migrate.gemspec
4
- gem 'rails', '~> 6.1.0'
4
+ %w[
5
+ activerecord
6
+ railties
7
+ ].each do |rails_gem|
8
+ gem rails_gem, '~> 6.1.0'
9
+ end
5
10
  gem 'sqlite3', "~> 1.4"
6
11
  gemspec
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
- s.add_dependency('rails', '>= 5.0')
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
@@ -1,3 +1,3 @@
1
1
  module DataMigrate
2
- VERSION = "6.8.0".freeze
2
+ VERSION = "7.0.2".freeze
3
3
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  class <%= migration_class_name %> < <%= migration_base_class_name %>
2
4
  def up
3
5
  end
@@ -1,2 +1 @@
1
- # encoding: UTF-8
2
1
  DataMigrate::Data.define(version: 20091231235959)
@@ -1,2 +1 @@
1
- # encoding: UTF-8
2
1
  DataMigrate::Data.define(version: 20091231235959)
@@ -1,2 +1 @@
1
- # encoding: UTF-8
2
1
  DataMigrate::Data.define(version: 20171231235959)
@@ -1,2 +1 @@
1
- # encoding: UTF-8
2
1
  DataMigrate::Data.define(version: 20171231235959)
data/tasks/databases.rake CHANGED
@@ -46,17 +46,7 @@ namespace :db do
46
46
  end
47
47
 
48
48
  migrations.each do |migration|
49
- if migration[:kind] == :data
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
- if migration[:kind] == :data
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
- if migration[:kind] == :data
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
- if past_migration[:kind] == :data
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: 6.8.0
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-04-18 00:00:00.000000000 Z
13
+ date: 2021-07-12 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
- name: rails
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
  - - ">="