ridgepole-replace_db_task 0.2.0 → 0.5.0

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: 5b4761e5d257e13ed5b0a561c10d10dc1b8e1fac6998a4f18b91f0787eae169c
4
- data.tar.gz: 15e9c6c84e24adbfa3105c272c85ff3c66374ac18024f8989473b05806038e07
3
+ metadata.gz: 53cedd2c95e52acc6a9d4ac961c3b205a6c8a5564a30471d763d539f87495f92
4
+ data.tar.gz: 07e74d2d4e6f8b9180b77f7d980295db67167d927cb1aa5dfa9e345aec3e9b17
5
5
  SHA512:
6
- metadata.gz: 79d267c0cf67938b7dacf7c6e343624854ded67948f30b09a1b5e04789a26e189847960405e87467c2ec7cb594dab3884e9a32a60f49794bf159724a2a9bb738
7
- data.tar.gz: '09e473bfc8f49c452505e0b3435b004af63d4f5eb58b6d2f8f159b7e44af42b08277a1cc8d21dcaa5ff615e63f4a528ffc2694b30dc2d59ddb3089ad7e4a32ad'
6
+ metadata.gz: da0c6612372642b7199aa4d622faa4e4b036e8af8c1cd1fb60cf6f4b29f96c5b4d9f44d13bfc1f1d59801d14b0edcec529cfc7db5694bb55ed2e2ce52c352c6c
7
+ data.tar.gz: 53fffd48addf32730d477cf135b5ee3d5a92a36f895443e9a92dcdb49ef814dded2aa35ef6c05ca272b0d352456ea96a1d3e6bf5b0cdb19c8147b0d82a447aa7
@@ -10,6 +10,8 @@ module Ridgepole
10
10
  config_accessor :schema_file_path
11
11
  config_accessor :skip_drop_table
12
12
  config_accessor :ignore_tables
13
+ config_accessor :migrate_with_test_when_development
14
+ config_accessor :multiple_migration_settings
13
15
  end
14
16
  end
15
17
  end
@@ -14,7 +14,7 @@ class Ridgepole::ReplaceDbTask::Executor
14
14
  -c #{Ridgepole::ReplaceDbTask.config.database_yml_path} \
15
15
  -f #{Ridgepole::ReplaceDbTask.config.schema_file_path} \
16
16
  #{ignore_tables_option} \
17
- #{skip_drop_table_option} \
17
+ #{drop_table_option} \
18
18
  #{@options} \
19
19
  -E #{@rails_env}
20
20
  EOD
@@ -50,8 +50,8 @@ EOD
50
50
  ignore_tables.present? ? '--ignore-tables ' + ignore_tables.map { |t| t.is_a?(Regexp) ? t.source : "^#{t}$" }.join(',') : ''
51
51
  end
52
52
 
53
- def skip_drop_table_option
53
+ def drop_table_option
54
54
  skip_drop_table = Ridgepole::ReplaceDbTask.config.skip_drop_table
55
- skip_drop_table ? '--skip-drop-table' : ''
55
+ skip_drop_table ? '' : '--drop-table'
56
56
  end
57
57
  end
@@ -1,5 +1,5 @@
1
1
  module Ridgepole
2
2
  module ReplaceDbTask
3
- VERSION = "0.2.0"
3
+ VERSION = "0.5.0"
4
4
  end
5
5
  end
@@ -21,8 +21,9 @@ module Ridgepole
21
21
 
22
22
  configure do |config|
23
23
  config.ridgepole = 'bundle exec ridgepole'
24
- config.skip_drop_table = false
24
+ config.skip_drop_table = true
25
25
  config.ignore_tables = []
26
+ config.multiple_migration_settings = {development: %i[test]}
26
27
  end
27
28
  end
28
29
  end
@@ -10,8 +10,9 @@ namespace :db do
10
10
  ENV['RAILS_ENV'] ||= 'development'
11
11
  apply(ENV['RAILS_ENV'], '--apply') { |line| puts line }
12
12
 
13
- if ENV['RAILS_ENV'] == 'development'
14
- apply('test', '--apply') { |line| puts line }
13
+ envs = ::Ridgepole::ReplaceDbTask.config.multiple_migration_settings.dig(ENV['RAILS_ENV'].to_sym) || []
14
+ envs.each do |env|
15
+ apply(env, '--apply') { |line| puts line }
15
16
  end
16
17
  end
17
18
 
@@ -22,7 +22,7 @@ Gem::Specification.new do |spec|
22
22
 
23
23
  spec.add_dependency "railties", ">= 5.0"
24
24
  spec.add_dependency "activesupport", ">= 5.0"
25
- spec.add_dependency "ridgepole", ">= 0.7"
25
+ spec.add_dependency "ridgepole", ">= 1.0"
26
26
 
27
27
  spec.add_development_dependency "bundler", "~> 2.0"
28
28
  spec.add_development_dependency "rake", "~> 10.0"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole-replace_db_task
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Ooishi
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-02-18 00:00:00.000000000 Z
11
+ date: 2022-04-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - ">="
46
46
  - !ruby/object:Gem::Version
47
- version: '0.7'
47
+ version: '1.0'
48
48
  type: :runtime
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - ">="
53
53
  - !ruby/object:Gem::Version
54
- version: '0.7'
54
+ version: '1.0'
55
55
  - !ruby/object:Gem::Dependency
56
56
  name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement