data_migrate 11.1.0 → 11.3.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 (59) hide show
  1. checksums.yaml +4 -4
  2. data/Changelog.md +11 -0
  3. data/README.md +13 -18
  4. data/lib/data_migrate/config.rb +2 -1
  5. data/lib/data_migrate/data_migrator.rb +0 -1
  6. data/lib/data_migrate/data_schema_migration.rb +2 -2
  7. data/lib/data_migrate/database_tasks.rb +14 -4
  8. data/lib/data_migrate/rails_helper.rb +1 -0
  9. data/lib/data_migrate/version.rb +1 -1
  10. metadata +5 -54
  11. data/.github/workflows/build.yml +0 -39
  12. data/.github/workflows/gempush.yml +0 -28
  13. data/.gitignore +0 -12
  14. data/.hound.yml +0 -4
  15. data/.overcommit.yml +0 -21
  16. data/.rbenv-gemsets +0 -2
  17. data/.rspec +0 -3
  18. data/.rubocop.yml +0 -2
  19. data/.ruby-style.yml +0 -1061
  20. data/Appraisals +0 -19
  21. data/Gemfile +0 -3
  22. data/Gemfile.lock +0 -192
  23. data/Rakefile +0 -2
  24. data/data_migrate.gemspec +0 -41
  25. data/gemfiles/rails_6.1.gemfile +0 -7
  26. data/gemfiles/rails_6.1.gemfile.lock +0 -237
  27. data/gemfiles/rails_7.0.gemfile +0 -7
  28. data/gemfiles/rails_7.0.gemfile.lock +0 -238
  29. data/gemfiles/rails_7.1.gemfile +0 -7
  30. data/gemfiles/rails_7.1.gemfile.lock +0 -277
  31. data/gemfiles/rails_7.2.gemfile +0 -7
  32. data/gemfiles/rails_7.2.gemfile.lock +0 -274
  33. data/gemfiles/rails_8.0.gemfile +0 -7
  34. data/gemfiles/rails_8.0.gemfile.lock +0 -268
  35. data/screenshot.png +0 -0
  36. data/spec/data_migrate/config_spec.rb +0 -69
  37. data/spec/data_migrate/data_migrator_spec.rb +0 -84
  38. data/spec/data_migrate/data_schema_migration_spec.rb +0 -33
  39. data/spec/data_migrate/data_spec.rb +0 -74
  40. data/spec/data_migrate/database_tasks_spec.rb +0 -214
  41. data/spec/data_migrate/migration.rb +0 -17
  42. data/spec/data_migrate/migration_context_spec.rb +0 -117
  43. data/spec/data_migrate/schema_dumper_spec.rb +0 -36
  44. data/spec/data_migrate/schema_migration_spec.rb +0 -104
  45. data/spec/data_migrate/status_service_spec.rb +0 -76
  46. data/spec/data_migrate/tasks/data_migrate_tasks_spec.rb +0 -129
  47. data/spec/db/data/20091231235959_some_name.rb +0 -9
  48. data/spec/db/data/20171231235959_super_update.rb +0 -9
  49. data/spec/db/data/20181128000207_excluded_file.rb.other_ext +0 -1
  50. data/spec/db/data/partial_schema/data_schema.rb +0 -1
  51. data/spec/db/data/partial_schema/test_data_schema.rb +0 -1
  52. data/spec/db/data/schema/data_schema.rb +0 -1
  53. data/spec/db/data/schema/test_data_schema.rb +0 -1
  54. data/spec/db/data_two/20241231235959_data_two_update.rb +0 -9
  55. data/spec/db/migrate/20131111111111_late_migration.rb +0 -9
  56. data/spec/db/migrate/20202020202011_db_migration.rb +0 -9
  57. data/spec/generators/data_migration/data_migration_generator_spec.rb +0 -101
  58. data/spec/spec_helper.rb +0 -28
  59. data/tasks/.gitkeep +0 -0
@@ -1,274 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- data_migrate (11.1.0)
5
- activerecord (>= 6.1)
6
- railties (>= 6.1)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- actioncable (7.2.0)
12
- actionpack (= 7.2.0)
13
- activesupport (= 7.2.0)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- zeitwerk (~> 2.6)
17
- actionmailbox (7.2.0)
18
- actionpack (= 7.2.0)
19
- activejob (= 7.2.0)
20
- activerecord (= 7.2.0)
21
- activestorage (= 7.2.0)
22
- activesupport (= 7.2.0)
23
- mail (>= 2.8.0)
24
- actionmailer (7.2.0)
25
- actionpack (= 7.2.0)
26
- actionview (= 7.2.0)
27
- activejob (= 7.2.0)
28
- activesupport (= 7.2.0)
29
- mail (>= 2.8.0)
30
- rails-dom-testing (~> 2.2)
31
- actionpack (7.2.0)
32
- actionview (= 7.2.0)
33
- activesupport (= 7.2.0)
34
- nokogiri (>= 1.8.5)
35
- racc
36
- rack (>= 2.2.4, < 3.2)
37
- rack-session (>= 1.0.1)
38
- rack-test (>= 0.6.3)
39
- rails-dom-testing (~> 2.2)
40
- rails-html-sanitizer (~> 1.6)
41
- useragent (~> 0.16)
42
- actiontext (7.2.0)
43
- actionpack (= 7.2.0)
44
- activerecord (= 7.2.0)
45
- activestorage (= 7.2.0)
46
- activesupport (= 7.2.0)
47
- globalid (>= 0.6.0)
48
- nokogiri (>= 1.8.5)
49
- actionview (7.2.0)
50
- activesupport (= 7.2.0)
51
- builder (~> 3.1)
52
- erubi (~> 1.11)
53
- rails-dom-testing (~> 2.2)
54
- rails-html-sanitizer (~> 1.6)
55
- activejob (7.2.0)
56
- activesupport (= 7.2.0)
57
- globalid (>= 0.3.6)
58
- activemodel (7.2.0)
59
- activesupport (= 7.2.0)
60
- activerecord (7.2.0)
61
- activemodel (= 7.2.0)
62
- activesupport (= 7.2.0)
63
- timeout (>= 0.4.0)
64
- activestorage (7.2.0)
65
- actionpack (= 7.2.0)
66
- activejob (= 7.2.0)
67
- activerecord (= 7.2.0)
68
- activesupport (= 7.2.0)
69
- marcel (~> 1.0)
70
- activesupport (7.2.0)
71
- base64
72
- bigdecimal
73
- concurrent-ruby (~> 1.0, >= 1.3.1)
74
- connection_pool (>= 2.2.5)
75
- drb
76
- i18n (>= 1.6, < 2)
77
- logger (>= 1.4.2)
78
- minitest (>= 5.1)
79
- securerandom (>= 0.3)
80
- tzinfo (~> 2.0, >= 2.0.5)
81
- appraisal (2.5.0)
82
- bundler
83
- rake
84
- thor (>= 0.14.0)
85
- ast (2.4.2)
86
- base64 (0.2.0)
87
- bigdecimal (3.1.8)
88
- builder (3.3.0)
89
- childprocess (5.0.0)
90
- coderay (1.1.3)
91
- concurrent-ruby (1.3.4)
92
- connection_pool (2.4.1)
93
- crass (1.0.6)
94
- date (3.3.4)
95
- diff-lcs (1.5.1)
96
- drb (2.2.1)
97
- erubi (1.13.0)
98
- globalid (1.2.1)
99
- activesupport (>= 6.1)
100
- i18n (1.14.5)
101
- concurrent-ruby (~> 1.0)
102
- iniparse (1.5.0)
103
- io-console (0.7.2)
104
- irb (1.14.0)
105
- rdoc (>= 4.0.0)
106
- reline (>= 0.4.2)
107
- json (2.7.2)
108
- language_server-protocol (3.17.0.3)
109
- logger (1.6.0)
110
- loofah (2.22.0)
111
- crass (~> 1.0.2)
112
- nokogiri (>= 1.12.0)
113
- mail (2.8.1)
114
- mini_mime (>= 0.1.1)
115
- net-imap
116
- net-pop
117
- net-smtp
118
- marcel (1.0.4)
119
- method_source (1.1.0)
120
- mini_mime (1.1.5)
121
- mini_portile2 (2.8.7)
122
- minitest (5.25.1)
123
- net-imap (0.4.14)
124
- date
125
- net-protocol
126
- net-pop (0.1.2)
127
- net-protocol
128
- net-protocol (0.2.2)
129
- timeout
130
- net-smtp (0.5.0)
131
- net-protocol
132
- nio4r (2.7.3)
133
- nokogiri (1.16.7)
134
- mini_portile2 (~> 2.8.2)
135
- racc (~> 1.4)
136
- nokogiri (1.16.7-aarch64-linux)
137
- racc (~> 1.4)
138
- nokogiri (1.16.7-arm64-darwin)
139
- racc (~> 1.4)
140
- nokogiri (1.16.7-x86_64-darwin)
141
- racc (~> 1.4)
142
- nokogiri (1.16.7-x86_64-linux)
143
- racc (~> 1.4)
144
- overcommit (0.63.0)
145
- childprocess (>= 0.6.3, < 6)
146
- iniparse (~> 1.4)
147
- rexml (~> 3.2)
148
- parallel (1.24.0)
149
- parser (3.3.1.0)
150
- ast (~> 2.4.1)
151
- racc
152
- pry (0.14.2)
153
- coderay (~> 1.1)
154
- method_source (~> 1.0)
155
- psych (5.1.2)
156
- stringio
157
- racc (1.8.1)
158
- rack (3.1.7)
159
- rack-session (2.0.0)
160
- rack (>= 3.0.0)
161
- rack-test (2.1.0)
162
- rack (>= 1.3)
163
- rackup (2.1.0)
164
- rack (>= 3)
165
- webrick (~> 1.8)
166
- rails (7.2.0)
167
- actioncable (= 7.2.0)
168
- actionmailbox (= 7.2.0)
169
- actionmailer (= 7.2.0)
170
- actionpack (= 7.2.0)
171
- actiontext (= 7.2.0)
172
- actionview (= 7.2.0)
173
- activejob (= 7.2.0)
174
- activemodel (= 7.2.0)
175
- activerecord (= 7.2.0)
176
- activestorage (= 7.2.0)
177
- activesupport (= 7.2.0)
178
- bundler (>= 1.15.0)
179
- railties (= 7.2.0)
180
- rails-dom-testing (2.2.0)
181
- activesupport (>= 5.0.0)
182
- minitest
183
- nokogiri (>= 1.6)
184
- rails-html-sanitizer (1.6.0)
185
- loofah (~> 2.21)
186
- nokogiri (~> 1.14)
187
- railties (7.2.0)
188
- actionpack (= 7.2.0)
189
- activesupport (= 7.2.0)
190
- irb (~> 1.13)
191
- rackup (>= 1.0.0)
192
- rake (>= 12.2)
193
- thor (~> 1.0, >= 1.2.2)
194
- zeitwerk (~> 2.6)
195
- rainbow (3.1.1)
196
- rake (13.2.1)
197
- rb-readline (0.5.5)
198
- rdoc (6.7.0)
199
- psych (>= 4.0.0)
200
- regexp_parser (2.9.2)
201
- reline (0.5.9)
202
- io-console (~> 0.5)
203
- rexml (3.2.8)
204
- strscan (>= 3.0.9)
205
- rspec (3.13.0)
206
- rspec-core (~> 3.13.0)
207
- rspec-expectations (~> 3.13.0)
208
- rspec-mocks (~> 3.13.0)
209
- rspec-core (3.13.0)
210
- rspec-support (~> 3.13.0)
211
- rspec-expectations (3.13.0)
212
- diff-lcs (>= 1.2.0, < 2.0)
213
- rspec-support (~> 3.13.0)
214
- rspec-mocks (3.13.1)
215
- diff-lcs (>= 1.2.0, < 2.0)
216
- rspec-support (~> 3.13.0)
217
- rspec-support (3.13.1)
218
- rubocop (1.64.0)
219
- json (~> 2.3)
220
- language_server-protocol (>= 3.17.0)
221
- parallel (~> 1.10)
222
- parser (>= 3.3.0.2)
223
- rainbow (>= 2.2.2, < 4.0)
224
- regexp_parser (>= 1.8, < 3.0)
225
- rexml (>= 3.2.5, < 4.0)
226
- rubocop-ast (>= 1.31.1, < 2.0)
227
- ruby-progressbar (~> 1.7)
228
- unicode-display_width (>= 2.4.0, < 3.0)
229
- rubocop-ast (1.31.3)
230
- parser (>= 3.3.1.0)
231
- ruby-progressbar (1.13.0)
232
- securerandom (0.3.1)
233
- sqlite3 (2.0.2-aarch64-linux-gnu)
234
- sqlite3 (2.0.2-arm64-darwin)
235
- sqlite3 (2.0.2-x86_64-darwin)
236
- sqlite3 (2.0.2-x86_64-linux-gnu)
237
- stringio (3.1.1)
238
- strscan (3.1.0)
239
- thor (1.3.1)
240
- timecop (0.9.8)
241
- timeout (0.4.1)
242
- tzinfo (2.0.6)
243
- concurrent-ruby (~> 1.0)
244
- unicode-display_width (2.5.0)
245
- useragent (0.16.10)
246
- webrick (1.8.1)
247
- websocket-driver (0.7.6)
248
- websocket-extensions (>= 0.1.0)
249
- websocket-extensions (0.1.5)
250
- zeitwerk (2.6.17)
251
-
252
- PLATFORMS
253
- aarch64-linux
254
- arm64-darwin-23
255
- ruby
256
- x86_64-darwin-22
257
- x86_64-linux
258
-
259
- DEPENDENCIES
260
- appraisal
261
- data_migrate!
262
- overcommit
263
- pry
264
- rails (~> 7.2.0)
265
- rake
266
- rb-readline
267
- rspec
268
- rspec-core
269
- rubocop
270
- sqlite3
271
- timecop
272
-
273
- BUNDLED WITH
274
- 2.4.17
@@ -1,7 +0,0 @@
1
- # This file was generated by Appraisal
2
-
3
- source "http://rubygems.org"
4
-
5
- gem "rails", "8.0.0.beta1"
6
-
7
- gemspec path: "../"
@@ -1,268 +0,0 @@
1
- PATH
2
- remote: ..
3
- specs:
4
- data_migrate (11.1.0)
5
- activerecord (>= 6.1)
6
- railties (>= 6.1)
7
-
8
- GEM
9
- remote: http://rubygems.org/
10
- specs:
11
- actioncable (8.0.0.beta1)
12
- actionpack (= 8.0.0.beta1)
13
- activesupport (= 8.0.0.beta1)
14
- nio4r (~> 2.0)
15
- websocket-driver (>= 0.6.1)
16
- zeitwerk (~> 2.6)
17
- actionmailbox (8.0.0.beta1)
18
- actionpack (= 8.0.0.beta1)
19
- activejob (= 8.0.0.beta1)
20
- activerecord (= 8.0.0.beta1)
21
- activestorage (= 8.0.0.beta1)
22
- activesupport (= 8.0.0.beta1)
23
- mail (>= 2.8.0)
24
- actionmailer (8.0.0.beta1)
25
- actionpack (= 8.0.0.beta1)
26
- actionview (= 8.0.0.beta1)
27
- activejob (= 8.0.0.beta1)
28
- activesupport (= 8.0.0.beta1)
29
- mail (>= 2.8.0)
30
- rails-dom-testing (~> 2.2)
31
- actionpack (8.0.0.beta1)
32
- actionview (= 8.0.0.beta1)
33
- activesupport (= 8.0.0.beta1)
34
- nokogiri (>= 1.8.5)
35
- rack (>= 2.2.4)
36
- rack-session (>= 1.0.1)
37
- rack-test (>= 0.6.3)
38
- rails-dom-testing (~> 2.2)
39
- rails-html-sanitizer (~> 1.6)
40
- useragent (~> 0.16)
41
- actiontext (8.0.0.beta1)
42
- actionpack (= 8.0.0.beta1)
43
- activerecord (= 8.0.0.beta1)
44
- activestorage (= 8.0.0.beta1)
45
- activesupport (= 8.0.0.beta1)
46
- globalid (>= 0.6.0)
47
- nokogiri (>= 1.8.5)
48
- actionview (8.0.0.beta1)
49
- activesupport (= 8.0.0.beta1)
50
- builder (~> 3.1)
51
- erubi (~> 1.11)
52
- rails-dom-testing (~> 2.2)
53
- rails-html-sanitizer (~> 1.6)
54
- activejob (8.0.0.beta1)
55
- activesupport (= 8.0.0.beta1)
56
- globalid (>= 0.3.6)
57
- activemodel (8.0.0.beta1)
58
- activesupport (= 8.0.0.beta1)
59
- activerecord (8.0.0.beta1)
60
- activemodel (= 8.0.0.beta1)
61
- activesupport (= 8.0.0.beta1)
62
- timeout (>= 0.4.0)
63
- activestorage (8.0.0.beta1)
64
- actionpack (= 8.0.0.beta1)
65
- activejob (= 8.0.0.beta1)
66
- activerecord (= 8.0.0.beta1)
67
- activesupport (= 8.0.0.beta1)
68
- marcel (~> 1.0)
69
- activesupport (8.0.0.beta1)
70
- base64
71
- benchmark (>= 0.3)
72
- bigdecimal
73
- concurrent-ruby (~> 1.0, >= 1.3.1)
74
- connection_pool (>= 2.2.5)
75
- drb
76
- i18n (>= 1.6, < 2)
77
- logger (>= 1.4.2)
78
- minitest (>= 5.1)
79
- securerandom (>= 0.3)
80
- tzinfo (~> 2.0, >= 2.0.5)
81
- uri (>= 0.13.1)
82
- appraisal (2.5.0)
83
- bundler
84
- rake
85
- thor (>= 0.14.0)
86
- ast (2.4.2)
87
- base64 (0.2.0)
88
- benchmark (0.3.0)
89
- bigdecimal (3.1.8)
90
- builder (3.3.0)
91
- childprocess (5.1.0)
92
- logger (~> 1.5)
93
- coderay (1.1.3)
94
- concurrent-ruby (1.3.4)
95
- connection_pool (2.4.1)
96
- crass (1.0.6)
97
- date (3.3.4)
98
- diff-lcs (1.5.1)
99
- drb (2.2.1)
100
- erubi (1.13.0)
101
- globalid (1.2.1)
102
- activesupport (>= 6.1)
103
- i18n (1.14.6)
104
- concurrent-ruby (~> 1.0)
105
- iniparse (1.5.0)
106
- io-console (0.7.2)
107
- irb (1.14.1)
108
- rdoc (>= 4.0.0)
109
- reline (>= 0.4.2)
110
- json (2.7.2)
111
- language_server-protocol (3.17.0.3)
112
- logger (1.6.1)
113
- loofah (2.22.0)
114
- crass (~> 1.0.2)
115
- nokogiri (>= 1.12.0)
116
- mail (2.8.1)
117
- mini_mime (>= 0.1.1)
118
- net-imap
119
- net-pop
120
- net-smtp
121
- marcel (1.0.4)
122
- method_source (1.1.0)
123
- mini_mime (1.1.5)
124
- mini_portile2 (2.8.7)
125
- minitest (5.25.1)
126
- net-imap (0.4.16)
127
- date
128
- net-protocol
129
- net-pop (0.1.2)
130
- net-protocol
131
- net-protocol (0.2.2)
132
- timeout
133
- net-smtp (0.5.0)
134
- net-protocol
135
- nio4r (2.7.3)
136
- nokogiri (1.16.7)
137
- mini_portile2 (~> 2.8.2)
138
- racc (~> 1.4)
139
- nokogiri (1.16.7-arm64-darwin)
140
- racc (~> 1.4)
141
- overcommit (0.64.0)
142
- childprocess (>= 0.6.3, < 6)
143
- iniparse (~> 1.4)
144
- rexml (~> 3.2)
145
- parallel (1.26.3)
146
- parser (3.3.5.0)
147
- ast (~> 2.4.1)
148
- racc
149
- pry (0.14.2)
150
- coderay (~> 1.1)
151
- method_source (~> 1.0)
152
- psych (5.1.2)
153
- stringio
154
- racc (1.8.1)
155
- rack (3.1.7)
156
- rack-session (2.0.0)
157
- rack (>= 3.0.0)
158
- rack-test (2.1.0)
159
- rack (>= 1.3)
160
- rackup (2.1.0)
161
- rack (>= 3)
162
- webrick (~> 1.8)
163
- rails (8.0.0.beta1)
164
- actioncable (= 8.0.0.beta1)
165
- actionmailbox (= 8.0.0.beta1)
166
- actionmailer (= 8.0.0.beta1)
167
- actionpack (= 8.0.0.beta1)
168
- actiontext (= 8.0.0.beta1)
169
- actionview (= 8.0.0.beta1)
170
- activejob (= 8.0.0.beta1)
171
- activemodel (= 8.0.0.beta1)
172
- activerecord (= 8.0.0.beta1)
173
- activestorage (= 8.0.0.beta1)
174
- activesupport (= 8.0.0.beta1)
175
- bundler (>= 1.15.0)
176
- railties (= 8.0.0.beta1)
177
- rails-dom-testing (2.2.0)
178
- activesupport (>= 5.0.0)
179
- minitest
180
- nokogiri (>= 1.6)
181
- rails-html-sanitizer (1.6.0)
182
- loofah (~> 2.21)
183
- nokogiri (~> 1.14)
184
- railties (8.0.0.beta1)
185
- actionpack (= 8.0.0.beta1)
186
- activesupport (= 8.0.0.beta1)
187
- irb (~> 1.13)
188
- rackup (>= 1.0.0)
189
- rake (>= 12.2)
190
- thor (~> 1.0, >= 1.2.2)
191
- zeitwerk (~> 2.6)
192
- rainbow (3.1.1)
193
- rake (13.2.1)
194
- rb-readline (0.5.5)
195
- rdoc (6.7.0)
196
- psych (>= 4.0.0)
197
- regexp_parser (2.9.2)
198
- reline (0.5.10)
199
- io-console (~> 0.5)
200
- rexml (3.3.7)
201
- rspec (3.13.0)
202
- rspec-core (~> 3.13.0)
203
- rspec-expectations (~> 3.13.0)
204
- rspec-mocks (~> 3.13.0)
205
- rspec-core (3.13.1)
206
- rspec-support (~> 3.13.0)
207
- rspec-expectations (3.13.3)
208
- diff-lcs (>= 1.2.0, < 2.0)
209
- rspec-support (~> 3.13.0)
210
- rspec-mocks (3.13.1)
211
- diff-lcs (>= 1.2.0, < 2.0)
212
- rspec-support (~> 3.13.0)
213
- rspec-support (3.13.1)
214
- rubocop (1.66.1)
215
- json (~> 2.3)
216
- language_server-protocol (>= 3.17.0)
217
- parallel (~> 1.10)
218
- parser (>= 3.3.0.2)
219
- rainbow (>= 2.2.2, < 4.0)
220
- regexp_parser (>= 2.4, < 3.0)
221
- rubocop-ast (>= 1.32.2, < 2.0)
222
- ruby-progressbar (~> 1.7)
223
- unicode-display_width (>= 2.4.0, < 3.0)
224
- rubocop-ast (1.32.3)
225
- parser (>= 3.3.1.0)
226
- ruby-progressbar (1.13.0)
227
- securerandom (0.3.1)
228
- sqlite3 (2.1.0)
229
- mini_portile2 (~> 2.8.0)
230
- sqlite3 (2.1.0-arm64-darwin)
231
- stringio (3.1.1)
232
- thor (1.3.2)
233
- timecop (0.9.10)
234
- timeout (0.4.1)
235
- tzinfo (2.0.6)
236
- concurrent-ruby (~> 1.0)
237
- unicode-display_width (2.6.0)
238
- uri (0.13.1)
239
- useragent (0.16.10)
240
- webrick (1.8.2)
241
- websocket-driver (0.7.6)
242
- websocket-extensions (>= 0.1.0)
243
- websocket-extensions (0.1.5)
244
- zeitwerk (2.6.18)
245
-
246
- PLATFORMS
247
- aarch64-linux
248
- arm64-darwin-23
249
- ruby
250
- x86_64-darwin-22
251
- x86_64-linux
252
-
253
- DEPENDENCIES
254
- appraisal
255
- data_migrate!
256
- overcommit
257
- pry
258
- rails (= 8.0.0.beta1)
259
- rake
260
- rb-readline
261
- rspec
262
- rspec-core
263
- rubocop
264
- sqlite3
265
- timecop
266
-
267
- BUNDLED WITH
268
- 2.4.17
data/screenshot.png DELETED
Binary file
@@ -1,69 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- describe DataMigrate::Config do
6
- it "sets default data_migrations_path path", :no_override do
7
- expect(DataMigrate.config.data_migrations_path).to eq "db/data/"
8
- end
9
-
10
- it "sets default data_template_path path", :no_override do
11
- expect(DataMigrate.config.data_template_path).to eq DataMigrate::Config::DEFAULT_DATA_TEMPLATE_PATH
12
- end
13
-
14
- describe "data migration path configured" do
15
- subject { DataMigrate.config.data_migrations_path }
16
- let(:data_migrations_path) { "db/awesome/" }
17
-
18
- before do
19
- @original_data_migrations_path = DataMigrate.config.data_migrations_path
20
-
21
- DataMigrate.configure do |config|
22
- config.data_migrations_path = data_migrations_path
23
- end
24
- end
25
-
26
- after do
27
- DataMigrate.configure do |config|
28
- config.data_migrations_path = @original_data_migrations_path
29
- end
30
- end
31
-
32
- it "equals the custom data migration path" do
33
- is_expected.to eq(data_migrations_path)
34
- end
35
- end
36
-
37
- describe "data template path configured" do
38
- subject { DataMigrate.config.data_template_path }
39
- let(:data_template_path) { File.join(DataMigrate.root, "generators", "data_migration", "templates", "data_migration.rb") }
40
-
41
- before do
42
- @original_data_migrations_path = DataMigrate.config.data_template_path
43
-
44
- DataMigrate.configure do |config|
45
- config.data_template_path = data_template_path
46
- end
47
- end
48
-
49
- after do
50
- DataMigrate.configure do |config|
51
- config.data_template_path = @original_data_migrations_path
52
- end
53
- end
54
-
55
- it "equals the custom data template path" do
56
- is_expected.to eq data_template_path
57
- end
58
-
59
- context "when path does not exist" do
60
- subject { DataMigrate.config.data_template_path = invalid_path }
61
-
62
- let(:invalid_path) { "lib/awesome/templates/data_migration.rb" }
63
-
64
- it "checks that file exists on setting config var" do
65
- expect { subject }.to raise_error { ArgumentError.new("File not found: '#{data_template_path}'") }
66
- end
67
- end
68
- end
69
- end
@@ -1,84 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require "spec_helper"
4
-
5
- describe DataMigrate::DataMigrator do
6
- let(:described_class) { DataMigrate::DataMigrator }
7
-
8
- let(:db_config) do
9
- {
10
- adapter: "sqlite3",
11
- database: "spec/db/test.db"
12
- }
13
- end
14
-
15
- before do
16
- ActiveRecord::Base.establish_connection(db_config)
17
- DataMigrate::RailsHelper.schema_migration.create_table
18
- DataMigrate::RailsHelper.data_schema_migration.create_table
19
- end
20
-
21
- after do
22
- ActiveRecord::Migration.drop_table("data_migrations") rescue nil
23
- ActiveRecord::Migration.drop_table("schema_migrations") rescue nil
24
- end
25
-
26
- describe ".load_migrated" do
27
- let(:migrator) { DataMigrate::RailsHelper.data_migrator(:up, []) }
28
-
29
- it "loads migrated versions" do
30
- DataMigrate::RailsHelper.data_schema_migration.create_version(20090000000000)
31
- DataMigrate::RailsHelper.schema_create_version(20100000000000)
32
- DataMigrate::RailsHelper.data_schema_migration.create_version(20110000000000)
33
- DataMigrate::RailsHelper.schema_create_version(20120000000000)
34
- migrated = migrator.load_migrated
35
- expect(migrated.count).to eq 2
36
- expect(migrated).to include 20090000000000
37
- expect(migrated).to include 20110000000000
38
- end
39
- end
40
-
41
- describe :create_data_schema_table do
42
- it "creates the data_migrations table" do
43
- ActiveRecord::Migration.drop_table("data_migrations") rescue nil
44
- described_class.create_data_schema_table
45
- expect(
46
- ActiveRecord::Base.connection.table_exists?("data_migrations")
47
- ).to eq true
48
- end
49
- end
50
-
51
- describe "#migrations_status" do
52
- it "returns all migrations statuses" do
53
- status = described_class.migrations_status
54
- expect(status.length).to eq 3
55
- expect(status.first).to eq ["down", "20091231235959", "Some name"]
56
- expect(status.second).to eq ["down", "20171231235959", "Super update"]
57
- expect(status.third).to eq ["down", "20241231235959", "Data two update"]
58
- end
59
- end
60
-
61
- describe :match do
62
- context "when the file does not match" do
63
- it "returns nil" do
64
- expect(described_class.match("not_a_data_migration_file")).to be_nil
65
- end
66
- end
67
-
68
- context "when the file doesn't end in .rb" do
69
- it "returns nil" do
70
- expect(described_class.match("20091231235959_some_name.rb.un~")).to be_nil
71
- end
72
- end
73
-
74
- context "when the file matches" do
75
- it "returns a valid MatchData object" do
76
- match_data = described_class.match("20091231235959_some_name.rb")
77
-
78
- expect(match_data[0]).to eq "20091231235959_some_name.rb"
79
- expect(match_data[1]).to eq "20091231235959"
80
- expect(match_data[2]).to eq "some_name"
81
- end
82
- end
83
- end
84
- end