storey 1.0.0 → 2.0.0

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.
Files changed (43) hide show
  1. checksums.yaml +5 -5
  2. data/.ruby-version +1 -1
  3. data/.travis.yml +11 -7
  4. data/Appraisals +9 -4
  5. data/CHANGELOG.md +26 -9
  6. data/Gemfile +1 -2
  7. data/README.md +13 -0
  8. data/docker-compose.yml +10 -0
  9. data/gemfiles/rails_5.0.gemfile +10 -0
  10. data/gemfiles/rails_5.0.gemfile.lock +154 -0
  11. data/gemfiles/rails_5.1.gemfile +9 -0
  12. data/gemfiles/rails_5.1.gemfile.lock +153 -0
  13. data/gemfiles/rails_5.2.gemfile +9 -0
  14. data/gemfiles/rails_5.2.gemfile.lock +161 -0
  15. data/lib/storey/builds_dump_command.rb +7 -1
  16. data/lib/storey/duplicator.rb +2 -6
  17. data/lib/storey/get_migration_versions.rb +21 -0
  18. data/lib/storey/migrator.rb +29 -8
  19. data/lib/storey/sql_dumper.rb +10 -6
  20. data/lib/storey/suffixifier.rb +2 -2
  21. data/lib/storey/version.rb +1 -1
  22. data/lib/storey.rb +6 -7
  23. data/spec/dummy/config/database.yml.sample +2 -1
  24. data/spec/dummy/config/initializers/migrations_path.rb +2 -2
  25. data/spec/dummy/db/migrate/20120115060713_create_companies.rb +1 -1
  26. data/spec/dummy/db/migrate/20120115060728_create_posts.rb +1 -1
  27. data/spec/migrator_spec.rb +15 -10
  28. data/spec/storey/builds_dump_command_spec.rb +26 -0
  29. data/spec/storey/create_spec.rb +2 -2
  30. data/spec/storey/duplicate_spec.rb +2 -2
  31. data/spec/storey/get_migration_versions_spec.rb +42 -0
  32. data/spec/storey/schema_search_path_for_spec.rb +2 -2
  33. data/spec/storey/schema_spec.rb +6 -0
  34. data/spec/storey/schemas_spec.rb +15 -7
  35. data/spec/storey/suffixifier_spec.rb +4 -4
  36. data/spec/storey/switch_spec.rb +4 -2
  37. data/spec/tasks/storey_rake_spec.rb +12 -12
  38. data/storey.gemspec +2 -2
  39. metadata +29 -23
  40. data/gemfiles/rails_3.gemfile +0 -9
  41. data/gemfiles/rails_3.gemfile.lock +0 -130
  42. data/gemfiles/rails_4.gemfile +0 -9
  43. data/gemfiles/rails_4.gemfile.lock +0 -144
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: f93db34c26e33e896d15e0531d6b2a19e75036af
4
- data.tar.gz: 98643e29f8b4fea7bbdd4bbf155314c5f26207a8
2
+ SHA256:
3
+ metadata.gz: 96b899561dd23de46f98076d2c0be5b4709bab72e203287f7c0768abb2bcf1be
4
+ data.tar.gz: 7293df70c6f9cd032e0dd901ae7cd082f4e00a44363e8cce885540eead4beb16
5
5
  SHA512:
6
- metadata.gz: 4d0a41055ff277ef8d50a814a81bbbb844a6cf7344fdaa638c1a8c18a8141fec4ae216c76e7590b3cffe24882c359291078af6057a466472864fc15a40da1a5a
7
- data.tar.gz: 4b37352130f61db6630cffbd0a02525862b121c8668415d0072b5db8182f3c6e1410f759e3522c4860b7924bfee08b3e8edca784a33003de832c1661428dab3d
6
+ metadata.gz: 678ac169863de8312035dea1069d8bd081bc91b68a98e3fd43f09255d58223e0c46719e854bd3b1759c13d3563c1289b5a49df3c3aaa982010466a17c313e63e
7
+ data.tar.gz: d1c97327f715e719938d092ca09119ec6f78d54757ed21c179895fdb528b501c5dfee9b1581a7ea28dbd3e6b5f61ff3962eae3ace55a853d4643bd3d83f6aac6
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- ruby-2.1.1
1
+ ruby-2.5.0
data/.travis.yml CHANGED
@@ -1,12 +1,16 @@
1
+ sudo: required
1
2
  language: ruby
2
- rvm:
3
- - 1.9.3
4
- - 2.1.1
5
3
  services:
6
- - postgresql
4
+ postgresql
5
+ addons:
6
+ postgresql: 9.4
7
7
  before_script:
8
8
  - cp spec/dummy/config/database.yml{.sample,}
9
- - psql -c 'create database storey_test;' -U postgres
9
+ - psql -U postgres -c 'CREATE DATABASE storey_test;'
10
10
  gemfile:
11
- - gemfiles/rails_3.gemfile
12
- - gemfiles/rails_4.gemfile
11
+ - gemfiles/rails_5.0.gemfile
12
+ - gemfiles/rails_5.1.gemfile
13
+ - gemfiles/rails_5.2.gemfile
14
+ rvm:
15
+ - 2.4.1
16
+ - 2.5.0
data/Appraisals CHANGED
@@ -1,7 +1,12 @@
1
- appraise "rails-3" do
2
- gem "rails", "3.2.14"
1
+ appraise "rails-5.0" do
2
+ gem "pg", "~> 0.21" # Rails 5.0 does not work with pg 1.x
3
+ gem "rails", "~> 5.0.0"
3
4
  end
4
5
 
5
- appraise "rails-4" do
6
- gem "rails", "4.2.1"
6
+ appraise "rails-5.1" do
7
+ gem "rails", "~> 5.1.0"
8
+ end
9
+
10
+ appraise "rails-5.2" do
11
+ gem "rails", "~> 5.2.0"
7
12
  end
data/CHANGELOG.md CHANGED
@@ -1,23 +1,40 @@
1
- # v1.0.0
1
+ # Change Log
2
+ All notable changes to this project will be documented in this file.
3
+ This project adheres to [Semantic Versioning](http://semver.org/).
2
4
 
3
- - It's already being used in production. About time for a 1.0.0 release.
5
+ ## [2.0.0]
6
+ ### Added
7
+ - Rails 5 support
8
+ - Add ability to get the current schema as an array of strings (`array: true`)
9
+ - Fix specs where PG may or may not return the schemas as with leading spaces (`public, foo,bar`)
4
10
 
5
- # v0.6.0
11
+ ### Changed
12
+ - Removed support for Rails 3, 4 and Ruby 2.3. They are no longer tested.
13
+ - Test against Ruby 2.5.0
6
14
 
7
- - Relax pg version dependency. Works with `~> 0.12`
15
+ ### Fixed
16
+ - Fixed dumping of sql files when pg host is remote
8
17
 
9
- # v0.5.1
18
+ ## [1.0.0]
19
+ ### Added
20
+ - It's already being used in production. About time for a 1.0.0 release.
10
21
 
11
- - Relax Rails version dependency. Works with `4.0`.
22
+ ## [0.6.0]
23
+ ### Changed
24
+ - Relax pg version dependency. Works with `~> 0.12`
12
25
 
13
- # v0.5.0
26
+ ## [0.5.1]
27
+ ### Changed
28
+ - Relax Rails version dependency. Works with `4.0`.
14
29
 
30
+ ## [0.5.0]
31
+ ### Changed
15
32
  - Removed attr_accessors from Storey::Duplicator (they were never meant to be part of the public API anyway)
16
33
  - Validate the schema name when creating schemas
17
34
  - Clean source and target files after duplicating [#18](https://github.com/ramontayag/storey/issues/18)
18
35
 
19
- # v0.4.2
20
-
36
+ ## [0.4.2]
37
+ ### Added
21
38
  - `rake storey:migrate VERSION=xxxx` now works and uses the `VERSION` environment variable
22
39
  - `reset_column_information` of all models to avoid strange PostgreSQL errors (see https://github.com/ramontayag/storey/issues/11)
23
40
  - Add this CHANGELOG :)
data/Gemfile CHANGED
@@ -1,8 +1,7 @@
1
- source "http://rubygems.org"
1
+ source "https://rubygems.org"
2
2
 
3
3
  # Specify your gem's dependencies in storey.gemspec
4
4
  gemspec
5
5
 
6
6
  gem 'pry'
7
-
8
7
  gem 'appraisal'
data/README.md CHANGED
@@ -24,6 +24,19 @@ Typically set in an initializer: `config/initializer/storey.rb`
24
24
 
25
25
  # Methods
26
26
 
27
+ ## schema
28
+
29
+ Return the current schema.
30
+
31
+ Accepts options
32
+
33
+ array: true # return the schemas as an array
34
+
35
+ Usage:
36
+
37
+ Storey.schema # "\"$user\", public"
38
+ Storey.schema(array: true) ["\"$user\"", "public"]
39
+
27
40
  ## schemas
28
41
 
29
42
  Returns all schemas except postgres' schemas.
@@ -0,0 +1,10 @@
1
+ version: "3"
2
+ services:
3
+ db:
4
+ image: postgres:9.6
5
+ ports:
6
+ - "5432:5432"
7
+ volumes:
8
+ - postgres:/var/lib/postgresql/data
9
+ volumes:
10
+ postgres:
@@ -0,0 +1,10 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pry"
6
+ gem "appraisal"
7
+ gem "pg", "~> 0.21"
8
+ gem "rails", "~> 5.0.0"
9
+
10
+ gemspec path: "../"
@@ -0,0 +1,154 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ storey (1.0.0)
5
+ easy_class_to_instance_method (~> 0.0.2)
6
+ pg
7
+ rails (>= 4.0.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.0.0)
13
+ actionpack (= 5.0.0)
14
+ nio4r (~> 1.2)
15
+ websocket-driver (~> 0.6.1)
16
+ actionmailer (5.0.0)
17
+ actionpack (= 5.0.0)
18
+ actionview (= 5.0.0)
19
+ activejob (= 5.0.0)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.0.0)
23
+ actionview (= 5.0.0)
24
+ activesupport (= 5.0.0)
25
+ rack (~> 2.0)
26
+ rack-test (~> 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.0.0)
30
+ activesupport (= 5.0.0)
31
+ builder (~> 3.1)
32
+ erubis (~> 2.7.0)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
35
+ activejob (5.0.0)
36
+ activesupport (= 5.0.0)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.0.0)
39
+ activesupport (= 5.0.0)
40
+ activerecord (5.0.0)
41
+ activemodel (= 5.0.0)
42
+ activesupport (= 5.0.0)
43
+ arel (~> 7.0)
44
+ activesupport (5.0.0)
45
+ concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ i18n (~> 0.7)
47
+ minitest (~> 5.1)
48
+ tzinfo (~> 1.1)
49
+ appraisal (2.2.0)
50
+ bundler
51
+ rake
52
+ thor (>= 0.14.0)
53
+ arel (7.0.0)
54
+ builder (3.2.3)
55
+ coderay (1.1.2)
56
+ concurrent-ruby (1.0.5)
57
+ crass (1.0.4)
58
+ database_cleaner (1.7.0)
59
+ diff-lcs (1.3)
60
+ easy_class_to_instance_method (0.0.2)
61
+ erubis (2.7.0)
62
+ globalid (0.4.1)
63
+ activesupport (>= 4.2.0)
64
+ i18n (0.9.5)
65
+ concurrent-ruby (~> 1.0)
66
+ loofah (2.2.2)
67
+ crass (~> 1.0.2)
68
+ nokogiri (>= 1.5.9)
69
+ mail (2.7.0)
70
+ mini_mime (>= 0.1.1)
71
+ method_source (0.9.0)
72
+ mini_mime (1.0.0)
73
+ mini_portile2 (2.3.0)
74
+ minitest (5.11.3)
75
+ nio4r (1.2.1)
76
+ nokogiri (1.8.3)
77
+ mini_portile2 (~> 2.3.0)
78
+ pg (0.21.0)
79
+ pry (0.11.3)
80
+ coderay (~> 1.1.0)
81
+ method_source (~> 0.9.0)
82
+ rack (2.0.5)
83
+ rack-test (0.6.3)
84
+ rack (>= 1.0)
85
+ rails (5.0.0)
86
+ actioncable (= 5.0.0)
87
+ actionmailer (= 5.0.0)
88
+ actionpack (= 5.0.0)
89
+ actionview (= 5.0.0)
90
+ activejob (= 5.0.0)
91
+ activemodel (= 5.0.0)
92
+ activerecord (= 5.0.0)
93
+ activesupport (= 5.0.0)
94
+ bundler (>= 1.3.0, < 2.0)
95
+ railties (= 5.0.0)
96
+ sprockets-rails (>= 2.0.0)
97
+ rails-dom-testing (2.0.3)
98
+ activesupport (>= 4.2.0)
99
+ nokogiri (>= 1.6)
100
+ rails-html-sanitizer (1.0.4)
101
+ loofah (~> 2.2, >= 2.2.2)
102
+ railties (5.0.0)
103
+ actionpack (= 5.0.0)
104
+ activesupport (= 5.0.0)
105
+ method_source
106
+ rake (>= 0.8.7)
107
+ thor (>= 0.18.1, < 2.0)
108
+ rake (12.3.1)
109
+ rspec-core (3.7.1)
110
+ rspec-support (~> 3.7.0)
111
+ rspec-expectations (3.7.0)
112
+ diff-lcs (>= 1.2.0, < 2.0)
113
+ rspec-support (~> 3.7.0)
114
+ rspec-mocks (3.7.0)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.7.0)
117
+ rspec-rails (3.7.2)
118
+ actionpack (>= 3.0)
119
+ activesupport (>= 3.0)
120
+ railties (>= 3.0)
121
+ rspec-core (~> 3.7.0)
122
+ rspec-expectations (~> 3.7.0)
123
+ rspec-mocks (~> 3.7.0)
124
+ rspec-support (~> 3.7.0)
125
+ rspec-support (3.7.1)
126
+ sprockets (3.7.2)
127
+ concurrent-ruby (~> 1.0)
128
+ rack (> 1, < 3)
129
+ sprockets-rails (3.2.1)
130
+ actionpack (>= 4.0)
131
+ activesupport (>= 4.0)
132
+ sprockets (>= 3.0.0)
133
+ thor (0.20.0)
134
+ thread_safe (0.3.6)
135
+ tzinfo (1.2.5)
136
+ thread_safe (~> 0.1)
137
+ websocket-driver (0.6.5)
138
+ websocket-extensions (>= 0.1.0)
139
+ websocket-extensions (0.1.3)
140
+
141
+ PLATFORMS
142
+ ruby
143
+
144
+ DEPENDENCIES
145
+ appraisal
146
+ database_cleaner
147
+ pg (~> 0.21)
148
+ pry
149
+ rails (~> 5.0.0)
150
+ rspec-rails
151
+ storey!
152
+
153
+ BUNDLED WITH
154
+ 1.16.2
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pry"
6
+ gem "appraisal"
7
+ gem "rails", "~> 5.1.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,153 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ storey (1.0.0)
5
+ easy_class_to_instance_method (~> 0.0.2)
6
+ pg
7
+ rails (>= 4.0.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.1.6)
13
+ actionpack (= 5.1.6)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (~> 0.6.1)
16
+ actionmailer (5.1.6)
17
+ actionpack (= 5.1.6)
18
+ actionview (= 5.1.6)
19
+ activejob (= 5.1.6)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.1.6)
23
+ actionview (= 5.1.6)
24
+ activesupport (= 5.1.6)
25
+ rack (~> 2.0)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.1.6)
30
+ activesupport (= 5.1.6)
31
+ builder (~> 3.1)
32
+ erubi (~> 1.4)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.1.6)
36
+ activesupport (= 5.1.6)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.1.6)
39
+ activesupport (= 5.1.6)
40
+ activerecord (5.1.6)
41
+ activemodel (= 5.1.6)
42
+ activesupport (= 5.1.6)
43
+ arel (~> 8.0)
44
+ activesupport (5.1.6)
45
+ concurrent-ruby (~> 1.0, >= 1.0.2)
46
+ i18n (>= 0.7, < 2)
47
+ minitest (~> 5.1)
48
+ tzinfo (~> 1.1)
49
+ appraisal (2.2.0)
50
+ bundler
51
+ rake
52
+ thor (>= 0.14.0)
53
+ arel (8.0.0)
54
+ builder (3.2.3)
55
+ coderay (1.1.2)
56
+ concurrent-ruby (1.0.5)
57
+ crass (1.0.4)
58
+ database_cleaner (1.7.0)
59
+ diff-lcs (1.3)
60
+ easy_class_to_instance_method (0.0.2)
61
+ erubi (1.7.1)
62
+ globalid (0.4.1)
63
+ activesupport (>= 4.2.0)
64
+ i18n (1.0.1)
65
+ concurrent-ruby (~> 1.0)
66
+ loofah (2.2.2)
67
+ crass (~> 1.0.2)
68
+ nokogiri (>= 1.5.9)
69
+ mail (2.7.0)
70
+ mini_mime (>= 0.1.1)
71
+ method_source (0.9.0)
72
+ mini_mime (1.0.0)
73
+ mini_portile2 (2.3.0)
74
+ minitest (5.11.3)
75
+ nio4r (2.3.1)
76
+ nokogiri (1.8.3)
77
+ mini_portile2 (~> 2.3.0)
78
+ pg (1.0.0)
79
+ pry (0.11.3)
80
+ coderay (~> 1.1.0)
81
+ method_source (~> 0.9.0)
82
+ rack (2.0.5)
83
+ rack-test (1.0.0)
84
+ rack (>= 1.0, < 3)
85
+ rails (5.1.6)
86
+ actioncable (= 5.1.6)
87
+ actionmailer (= 5.1.6)
88
+ actionpack (= 5.1.6)
89
+ actionview (= 5.1.6)
90
+ activejob (= 5.1.6)
91
+ activemodel (= 5.1.6)
92
+ activerecord (= 5.1.6)
93
+ activesupport (= 5.1.6)
94
+ bundler (>= 1.3.0)
95
+ railties (= 5.1.6)
96
+ sprockets-rails (>= 2.0.0)
97
+ rails-dom-testing (2.0.3)
98
+ activesupport (>= 4.2.0)
99
+ nokogiri (>= 1.6)
100
+ rails-html-sanitizer (1.0.4)
101
+ loofah (~> 2.2, >= 2.2.2)
102
+ railties (5.1.6)
103
+ actionpack (= 5.1.6)
104
+ activesupport (= 5.1.6)
105
+ method_source
106
+ rake (>= 0.8.7)
107
+ thor (>= 0.18.1, < 2.0)
108
+ rake (12.3.1)
109
+ rspec-core (3.7.1)
110
+ rspec-support (~> 3.7.0)
111
+ rspec-expectations (3.7.0)
112
+ diff-lcs (>= 1.2.0, < 2.0)
113
+ rspec-support (~> 3.7.0)
114
+ rspec-mocks (3.7.0)
115
+ diff-lcs (>= 1.2.0, < 2.0)
116
+ rspec-support (~> 3.7.0)
117
+ rspec-rails (3.7.2)
118
+ actionpack (>= 3.0)
119
+ activesupport (>= 3.0)
120
+ railties (>= 3.0)
121
+ rspec-core (~> 3.7.0)
122
+ rspec-expectations (~> 3.7.0)
123
+ rspec-mocks (~> 3.7.0)
124
+ rspec-support (~> 3.7.0)
125
+ rspec-support (3.7.1)
126
+ sprockets (3.7.2)
127
+ concurrent-ruby (~> 1.0)
128
+ rack (> 1, < 3)
129
+ sprockets-rails (3.2.1)
130
+ actionpack (>= 4.0)
131
+ activesupport (>= 4.0)
132
+ sprockets (>= 3.0.0)
133
+ thor (0.20.0)
134
+ thread_safe (0.3.6)
135
+ tzinfo (1.2.5)
136
+ thread_safe (~> 0.1)
137
+ websocket-driver (0.6.5)
138
+ websocket-extensions (>= 0.1.0)
139
+ websocket-extensions (0.1.3)
140
+
141
+ PLATFORMS
142
+ ruby
143
+
144
+ DEPENDENCIES
145
+ appraisal
146
+ database_cleaner
147
+ pry
148
+ rails (~> 5.1.0)
149
+ rspec-rails
150
+ storey!
151
+
152
+ BUNDLED WITH
153
+ 1.16.2
@@ -0,0 +1,9 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "pry"
6
+ gem "appraisal"
7
+ gem "rails", "~> 5.2.0"
8
+
9
+ gemspec path: "../"
@@ -0,0 +1,161 @@
1
+ PATH
2
+ remote: ..
3
+ specs:
4
+ storey (1.0.0)
5
+ easy_class_to_instance_method (~> 0.0.2)
6
+ pg
7
+ rails (>= 4.0.0)
8
+
9
+ GEM
10
+ remote: https://rubygems.org/
11
+ specs:
12
+ actioncable (5.2.0)
13
+ actionpack (= 5.2.0)
14
+ nio4r (~> 2.0)
15
+ websocket-driver (>= 0.6.1)
16
+ actionmailer (5.2.0)
17
+ actionpack (= 5.2.0)
18
+ actionview (= 5.2.0)
19
+ activejob (= 5.2.0)
20
+ mail (~> 2.5, >= 2.5.4)
21
+ rails-dom-testing (~> 2.0)
22
+ actionpack (5.2.0)
23
+ actionview (= 5.2.0)
24
+ activesupport (= 5.2.0)
25
+ rack (~> 2.0)
26
+ rack-test (>= 0.6.3)
27
+ rails-dom-testing (~> 2.0)
28
+ rails-html-sanitizer (~> 1.0, >= 1.0.2)
29
+ actionview (5.2.0)
30
+ activesupport (= 5.2.0)
31
+ builder (~> 3.1)
32
+ erubi (~> 1.4)
33
+ rails-dom-testing (~> 2.0)
34
+ rails-html-sanitizer (~> 1.0, >= 1.0.3)
35
+ activejob (5.2.0)
36
+ activesupport (= 5.2.0)
37
+ globalid (>= 0.3.6)
38
+ activemodel (5.2.0)
39
+ activesupport (= 5.2.0)
40
+ activerecord (5.2.0)
41
+ activemodel (= 5.2.0)
42
+ activesupport (= 5.2.0)
43
+ arel (>= 9.0)
44
+ activestorage (5.2.0)
45
+ actionpack (= 5.2.0)
46
+ activerecord (= 5.2.0)
47
+ marcel (~> 0.3.1)
48
+ activesupport (5.2.0)
49
+ concurrent-ruby (~> 1.0, >= 1.0.2)
50
+ i18n (>= 0.7, < 2)
51
+ minitest (~> 5.1)
52
+ tzinfo (~> 1.1)
53
+ appraisal (2.2.0)
54
+ bundler
55
+ rake
56
+ thor (>= 0.14.0)
57
+ arel (9.0.0)
58
+ builder (3.2.3)
59
+ coderay (1.1.2)
60
+ concurrent-ruby (1.0.5)
61
+ crass (1.0.4)
62
+ database_cleaner (1.7.0)
63
+ diff-lcs (1.3)
64
+ easy_class_to_instance_method (0.0.2)
65
+ erubi (1.7.1)
66
+ globalid (0.4.1)
67
+ activesupport (>= 4.2.0)
68
+ i18n (1.0.1)
69
+ concurrent-ruby (~> 1.0)
70
+ loofah (2.2.2)
71
+ crass (~> 1.0.2)
72
+ nokogiri (>= 1.5.9)
73
+ mail (2.7.0)
74
+ mini_mime (>= 0.1.1)
75
+ marcel (0.3.2)
76
+ mimemagic (~> 0.3.2)
77
+ method_source (0.9.0)
78
+ mimemagic (0.3.2)
79
+ mini_mime (1.0.0)
80
+ mini_portile2 (2.3.0)
81
+ minitest (5.11.3)
82
+ nio4r (2.3.1)
83
+ nokogiri (1.8.3)
84
+ mini_portile2 (~> 2.3.0)
85
+ pg (1.0.0)
86
+ pry (0.11.3)
87
+ coderay (~> 1.1.0)
88
+ method_source (~> 0.9.0)
89
+ rack (2.0.5)
90
+ rack-test (1.0.0)
91
+ rack (>= 1.0, < 3)
92
+ rails (5.2.0)
93
+ actioncable (= 5.2.0)
94
+ actionmailer (= 5.2.0)
95
+ actionpack (= 5.2.0)
96
+ actionview (= 5.2.0)
97
+ activejob (= 5.2.0)
98
+ activemodel (= 5.2.0)
99
+ activerecord (= 5.2.0)
100
+ activestorage (= 5.2.0)
101
+ activesupport (= 5.2.0)
102
+ bundler (>= 1.3.0)
103
+ railties (= 5.2.0)
104
+ sprockets-rails (>= 2.0.0)
105
+ rails-dom-testing (2.0.3)
106
+ activesupport (>= 4.2.0)
107
+ nokogiri (>= 1.6)
108
+ rails-html-sanitizer (1.0.4)
109
+ loofah (~> 2.2, >= 2.2.2)
110
+ railties (5.2.0)
111
+ actionpack (= 5.2.0)
112
+ activesupport (= 5.2.0)
113
+ method_source
114
+ rake (>= 0.8.7)
115
+ thor (>= 0.18.1, < 2.0)
116
+ rake (12.3.1)
117
+ rspec-core (3.7.1)
118
+ rspec-support (~> 3.7.0)
119
+ rspec-expectations (3.7.0)
120
+ diff-lcs (>= 1.2.0, < 2.0)
121
+ rspec-support (~> 3.7.0)
122
+ rspec-mocks (3.7.0)
123
+ diff-lcs (>= 1.2.0, < 2.0)
124
+ rspec-support (~> 3.7.0)
125
+ rspec-rails (3.7.2)
126
+ actionpack (>= 3.0)
127
+ activesupport (>= 3.0)
128
+ railties (>= 3.0)
129
+ rspec-core (~> 3.7.0)
130
+ rspec-expectations (~> 3.7.0)
131
+ rspec-mocks (~> 3.7.0)
132
+ rspec-support (~> 3.7.0)
133
+ rspec-support (3.7.1)
134
+ sprockets (3.7.2)
135
+ concurrent-ruby (~> 1.0)
136
+ rack (> 1, < 3)
137
+ sprockets-rails (3.2.1)
138
+ actionpack (>= 4.0)
139
+ activesupport (>= 4.0)
140
+ sprockets (>= 3.0.0)
141
+ thor (0.20.0)
142
+ thread_safe (0.3.6)
143
+ tzinfo (1.2.5)
144
+ thread_safe (~> 0.1)
145
+ websocket-driver (0.7.0)
146
+ websocket-extensions (>= 0.1.0)
147
+ websocket-extensions (0.1.3)
148
+
149
+ PLATFORMS
150
+ ruby
151
+
152
+ DEPENDENCIES
153
+ appraisal
154
+ database_cleaner
155
+ pry
156
+ rails (~> 5.2.0)
157
+ rspec-rails
158
+ storey!
159
+
160
+ BUNDLED WITH
161
+ 1.16.2
@@ -16,6 +16,8 @@ module Storey
16
16
  switches['schema-only'] = nil if @options[:structure_only]
17
17
  switches['no-privileges'] = nil
18
18
  switches['no-owner'] = nil
19
+ switches['host'] = @options[:host] if @options[:host].present?
20
+ switches['username'] = @options[:username] if @options[:username].present?
19
21
  switches[:file] = Shellwords.escape(@options[:file])
20
22
 
21
23
  if @options[:schemas]
@@ -25,7 +27,11 @@ module Storey
25
27
  end
26
28
  end
27
29
 
28
- command_parts = ['pg_dump',
30
+ command_parts = []
31
+ if @options[:password].present?
32
+ command_parts << "PGPASSWORD=#{@options[:password]}"
33
+ end
34
+ command_parts += ['pg_dump',
29
35
  Utils.command_line_switches_from(switches),
30
36
  schemas_switches,
31
37
  @options[:database]]
@@ -97,15 +97,11 @@ module Storey
97
97
  end
98
98
 
99
99
  def source_schema_migrations
100
- ::Storey.switch(@source_schema) do
101
- ::ActiveRecord::Migrator.get_all_versions
102
- end
100
+ GetMigrationVersions.(@source_schema)
103
101
  end
104
102
 
105
103
  def target_schema_migrations
106
- ::Storey.switch(@target_schema) do
107
- ::ActiveRecord::Migrator.get_all_versions
108
- end
104
+ GetMigrationVersions.(@target_schema)
109
105
  end
110
106
 
111
107
  def replace_occurrences