ridgepole-replace_db_task 0.1.0 → 0.4.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: 59fd5b67c158bfb71d38167b7040cb5dbe53036efbf90423fdb055b996d9e571
4
- data.tar.gz: a1c62493f236aa07c3ae1e1adab49d0d806425a349d4fdf6e0db42be83cf23a8
3
+ metadata.gz: 913aaa5b3bf2e3bae60e0a3bd6f302cb561dfd631d7b83b6bba7093597d10b26
4
+ data.tar.gz: 1556456d9b0d35edd56564c78c05522f2b84124ad6ce64de9e861050a26e62f3
5
5
  SHA512:
6
- metadata.gz: 7226b6db03167a61b59c6e4f4e1286383ac162bb659e1cf7cfe2d5086671548d4e75cbaaf4c35abecfe05f341135515d117face938884cb35498afd91c0e239c
7
- data.tar.gz: 421ab38dc2db7571f64ba1b51b1503f173ab052a0fe9eb34f641dd52202b635cc582dec94f3ed5eb7e3f9cb777ff45923fad26c71d3c9c7fa5ced778a628adf7
6
+ metadata.gz: 1da72ee0afc4a7a22da039131fad6c394886ed55ab614557154310291afa0a9dd2e4537233d7142e272c51b7d83a6e7115c3649173294f3a2f68674428299fa8
7
+ data.tar.gz: 7b249d396cc2845c0c08e059104fbaa59c6cfb8df8e4f09cf60ae2ca9becf9e49e2bc2a450fc5544d237aa9131c0516f75f56eaffec967b902c41356d8630a99
@@ -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
@@ -1,5 +1,5 @@
1
1
  class Ridgepole::ReplaceDbTask::Railtie < ::Rails::Railtie
2
2
  rake_tasks do
3
- load 'tasks/db.rake'
3
+ load 'tasks/replaced_db.rake'
4
4
  end
5
5
  end
@@ -1,5 +1,5 @@
1
1
  module Ridgepole
2
2
  module ReplaceDbTask
3
- VERSION = "0.1.0"
3
+ VERSION = "0.4.0"
4
4
  end
5
5
  end
@@ -23,6 +23,7 @@ module Ridgepole
23
23
  config.ridgepole = 'bundle exec ridgepole'
24
24
  config.skip_drop_table = false
25
25
  config.ignore_tables = []
26
+ config.multiple_migration_settings = {development: %i[test]}
26
27
  end
27
28
  end
28
29
  end
@@ -5,12 +5,14 @@ namespace :db do
5
5
  ::Ridgepole::ReplaceDbTask::Executor.call(rails_env, options, block)
6
6
  end
7
7
 
8
+ desc 'db migrate use ridgepole'
8
9
  task migrate: :environment do
9
10
  ENV['RAILS_ENV'] ||= 'development'
10
11
  apply(ENV['RAILS_ENV'], '--apply') { |line| puts line }
11
12
 
12
- if ENV['RAILS_ENV'] == 'development'
13
- 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 }
14
16
  end
15
17
  end
16
18
 
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.1.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Takahiro Ooishi
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-08-17 00:00:00.000000000 Z
11
+ date: 2022-04-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: railties
@@ -116,12 +116,12 @@ files:
116
116
  - lib/ridgepole/replace_db_task/executor.rb
117
117
  - lib/ridgepole/replace_db_task/railtie.rb
118
118
  - lib/ridgepole/replace_db_task/version.rb
119
- - lib/tasks/db.rake
119
+ - lib/tasks/replaced_db.rake
120
120
  - ridgepole-replace_db_task.gemspec
121
121
  homepage: https://github.com/taka0125/ridgepole-replace_db_task
122
122
  licenses: []
123
123
  metadata: {}
124
- post_install_message:
124
+ post_install_message:
125
125
  rdoc_options: []
126
126
  require_paths:
127
127
  - lib
@@ -137,7 +137,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
137
137
  version: '0'
138
138
  requirements: []
139
139
  rubygems_version: 3.0.3
140
- signing_key:
140
+ signing_key:
141
141
  specification_version: 4
142
142
  summary: Replace rails db:migrate to use ridgepole
143
143
  test_files: []