ridgepole 0.9.3 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (153) hide show
  1. checksums.yaml +4 -4
  2. data/Appraisals +4 -0
  3. data/CHANGELOG.md +238 -0
  4. data/README.md +12 -142
  5. data/bin/ridgepole +1 -1
  6. data/docker-compose.yml +26 -18
  7. data/gemfiles/activerecord_7.0.gemfile +7 -0
  8. data/lib/ridgepole/delta.rb +1 -1
  9. data/lib/ridgepole/diff.rb +4 -1
  10. data/lib/ridgepole/execute_expander.rb +5 -2
  11. data/lib/ridgepole/ext/abstract_adapter/disable_table_options.rb +1 -0
  12. data/lib/ridgepole/version.rb +1 -1
  13. data/ridgepole.gemspec +8 -5
  14. metadata +10 -284
  15. data/.github/workflows/test.yml +0 -70
  16. data/.gitignore +0 -25
  17. data/spec/cli_helper.rb +0 -65
  18. data/spec/dsl_parser/context_spec.rb +0 -16
  19. data/spec/erb_helper.rb +0 -26
  20. data/spec/fixtures/for_require_relative_spec.rb +0 -3
  21. data/spec/hide_pending_formatter.rb +0 -9
  22. data/spec/mysql/_migrate/migrate_change_table_option_spec.rb +0 -40
  23. data/spec/mysql/bigint_pk/int_pk_spec.rb +0 -47
  24. data/spec/mysql/cli/config_spec.rb +0 -210
  25. data/spec/mysql/cli/ridgepole_spec.rb +0 -447
  26. data/spec/mysql/collation/collation_spec.rb +0 -153
  27. data/spec/mysql/comment/comment_spec.rb +0 -179
  28. data/spec/mysql/default_lambda/default_lambda_spec.rb +0 -164
  29. data/spec/mysql/diff/diff2_spec.rb +0 -189
  30. data/spec/mysql/diff/diff_spec.rb +0 -168
  31. data/spec/mysql/dump/dump_class_method_spec.rb +0 -74
  32. data/spec/mysql/dump/dump_some_tables_spec.rb +0 -70
  33. data/spec/mysql/dump/dump_spec.rb +0 -74
  34. data/spec/mysql/dump/dump_unknown_column_type_spec.rb +0 -28
  35. data/spec/mysql/dump/dump_without_table_options_spec.rb +0 -34
  36. data/spec/mysql/fk/migrate_change_fk2_spec.rb +0 -47
  37. data/spec/mysql/fk/migrate_change_fk_spec.rb +0 -265
  38. data/spec/mysql/fk/migrate_create_fk_spec.rb +0 -349
  39. data/spec/mysql/fk/migrate_drop_fk_spec.rb +0 -331
  40. data/spec/mysql/fk/migrate_fk_with_column_spec.rb +0 -163
  41. data/spec/mysql/fk/migrate_ignore_fk_spec.rb +0 -70
  42. data/spec/mysql/migrate/check_orphan_index_spec.rb +0 -83
  43. data/spec/mysql/migrate/migrate_add_column2_spec.rb +0 -159
  44. data/spec/mysql/migrate/migrate_add_column_order_spec.rb +0 -242
  45. data/spec/mysql/migrate/migrate_add_column_spec.rb +0 -161
  46. data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +0 -231
  47. data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +0 -152
  48. data/spec/mysql/migrate/migrate_change_column2_spec.rb +0 -91
  49. data/spec/mysql/migrate/migrate_change_column3_spec.rb +0 -404
  50. data/spec/mysql/migrate/migrate_change_column4_spec.rb +0 -83
  51. data/spec/mysql/migrate/migrate_change_column5_spec.rb +0 -129
  52. data/spec/mysql/migrate/migrate_change_column6_spec.rb +0 -241
  53. data/spec/mysql/migrate/migrate_change_column7_spec.rb +0 -34
  54. data/spec/mysql/migrate/migrate_change_column8_spec.rb +0 -87
  55. data/spec/mysql/migrate/migrate_change_column_default_spec.rb +0 -199
  56. data/spec/mysql/migrate/migrate_change_column_float_spec.rb +0 -75
  57. data/spec/mysql/migrate/migrate_change_column_spec.rb +0 -158
  58. data/spec/mysql/migrate/migrate_change_index2_spec.rb +0 -86
  59. data/spec/mysql/migrate/migrate_change_index3_spec.rb +0 -179
  60. data/spec/mysql/migrate/migrate_change_index4_spec.rb +0 -112
  61. data/spec/mysql/migrate/migrate_change_index5_spec.rb +0 -74
  62. data/spec/mysql/migrate/migrate_change_index6_spec.rb +0 -202
  63. data/spec/mysql/migrate/migrate_change_index7_spec.rb +0 -85
  64. data/spec/mysql/migrate/migrate_change_index8_spec.rb +0 -85
  65. data/spec/mysql/migrate/migrate_change_index_spec.rb +0 -235
  66. data/spec/mysql/migrate/migrate_change_table_comment_spec.rb +0 -72
  67. data/spec/mysql/migrate/migrate_change_table_option_spec.rb +0 -83
  68. data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +0 -225
  69. data/spec/mysql/migrate/migrate_create_index2_spec.rb +0 -203
  70. data/spec/mysql/migrate/migrate_create_index_spec.rb +0 -220
  71. data/spec/mysql/migrate/migrate_create_table_spec.rb +0 -123
  72. data/spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb +0 -45
  73. data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +0 -43
  74. data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +0 -59
  75. data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +0 -132
  76. data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +0 -140
  77. data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +0 -167
  78. data/spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb +0 -52
  79. data/spec/mysql/migrate/migrate_drop_column_spec.rb +0 -158
  80. data/spec/mysql/migrate/migrate_drop_index_spec.rb +0 -160
  81. data/spec/mysql/migrate/migrate_drop_table_spec.rb +0 -123
  82. data/spec/mysql/migrate/migrate_duplicate_index_spec.rb +0 -27
  83. data/spec/mysql/migrate/migrate_duplicate_table_spec.rb +0 -37
  84. data/spec/mysql/migrate/migrate_empty_spec.rb +0 -78
  85. data/spec/mysql/migrate/migrate_execute_spec.rb +0 -288
  86. data/spec/mysql/migrate/migrate_ignore_column_spec.rb +0 -98
  87. data/spec/mysql/migrate/migrate_ignore_index_spec.rb +0 -92
  88. data/spec/mysql/migrate/migrate_log_file_spec.rb +0 -125
  89. data/spec/mysql/migrate/migrate_merge_mode_spec.rb +0 -145
  90. data/spec/mysql/migrate/migrate_noop_spec.rb +0 -234
  91. data/spec/mysql/migrate/migrate_primary_key_spec.rb +0 -104
  92. data/spec/mysql/migrate/migrate_rename_column_spec.rb +0 -184
  93. data/spec/mysql/migrate/migrate_rename_table_spec.rb +0 -241
  94. data/spec/mysql/migrate/migrate_same_default_null_spec.rb +0 -77
  95. data/spec/mysql/migrate/migrate_same_spec.rb +0 -82
  96. data/spec/mysql/migrate/migrate_script_error_spec.rb +0 -91
  97. data/spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb +0 -39
  98. data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +0 -145
  99. data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +0 -140
  100. data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +0 -141
  101. data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +0 -307
  102. data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +0 -153
  103. data/spec/mysql/migrate/migrate_with_tables_spec.rb +0 -149
  104. data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +0 -60
  105. data/spec/mysql/ridgepole_test_database.sql +0 -2
  106. data/spec/mysql/ridgepole_test_tables.sql +0 -79
  107. data/spec/mysql/ridgepole_test_tables_unknown_column_type.sql +0 -17
  108. data/spec/mysql/text_blob_types/text_blob_types_spec.rb +0 -131
  109. data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +0 -59
  110. data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +0 -133
  111. data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +0 -100
  112. data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +0 -43
  113. data/spec/mysql57/json/add_json_column_spec.rb +0 -35
  114. data/spec/mysql57/json/change_json_column_spec.rb +0 -102
  115. data/spec/mysql57/json/drop_json_column_spec.rb +0 -35
  116. data/spec/mysql57/virtual/add_virtual_column_spec.rb +0 -37
  117. data/spec/mysql57/virtual/change_virtual_column_spec.rb +0 -40
  118. data/spec/mysql57/virtual/drop_virtual_column_spec.rb +0 -37
  119. data/spec/postgresql/diff/diff_spec.rb +0 -216
  120. data/spec/postgresql/dump/dump_spec.rb +0 -69
  121. data/spec/postgresql/fk/migrate_change_fk_spec.rb +0 -115
  122. data/spec/postgresql/fk/migrate_create_fk_spec.rb +0 -176
  123. data/spec/postgresql/fk/migrate_drop_fk_spec.rb +0 -197
  124. data/spec/postgresql/migrate/migrate_add_column_spec.rb +0 -203
  125. data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +0 -25
  126. data/spec/postgresql/migrate/migrate_bigint_spec.rb +0 -53
  127. data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +0 -38
  128. data/spec/postgresql/migrate/migrate_change_column_spec.rb +0 -185
  129. data/spec/postgresql/migrate/migrate_change_index_spec.rb +0 -164
  130. data/spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb +0 -114
  131. data/spec/postgresql/migrate/migrate_create_table_spec.rb +0 -120
  132. data/spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb +0 -112
  133. data/spec/postgresql/migrate/migrate_drop_column_spec.rb +0 -163
  134. data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +0 -166
  135. data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +0 -59
  136. data/spec/postgresql/migrate/migrate_drop_index_spec.rb +0 -158
  137. data/spec/postgresql/migrate/migrate_drop_table_spec.rb +0 -122
  138. data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +0 -64
  139. data/spec/postgresql/migrate/migrate_primary_key2_spec.rb +0 -73
  140. data/spec/postgresql/migrate/migrate_primary_key_spec.rb +0 -99
  141. data/spec/postgresql/migrate/migrate_references_spec.rb +0 -90
  142. data/spec/postgresql/migrate/migrate_rename_column_spec.rb +0 -155
  143. data/spec/postgresql/migrate/migrate_rename_table_spec.rb +0 -175
  144. data/spec/postgresql/migrate/migrate_same_spec.rb +0 -77
  145. data/spec/postgresql/ridgepole_test_database.sql +0 -16
  146. data/spec/postgresql/ridgepole_test_tables.sql +0 -75
  147. data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +0 -59
  148. data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +0 -134
  149. data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +0 -100
  150. data/spec/processing_for_ci.rb +0 -13
  151. data/spec/spec_condition.rb +0 -58
  152. data/spec/spec_const.rb +0 -20
  153. data/spec/spec_helper.rb +0 -173
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.3
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-04-12 00:00:00.000000000 Z
11
+ date: 2021-12-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '5.1'
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: '6.2'
22
+ version: '7.1'
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '5.1'
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: '6.2'
32
+ version: '7.1'
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: diffy
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -271,18 +271,17 @@ dependencies:
271
271
  description: Ridgepole is a tool to manage DB schema. It defines DB schema using Rails
272
272
  DSL, and updates DB schema according to DSL.
273
273
  email:
274
- - sugawara@cookpad.com
274
+ - sugawara@winebarrel.jp
275
275
  executables:
276
276
  - ridgepole
277
277
  extensions: []
278
278
  extra_rdoc_files: []
279
279
  files:
280
- - ".github/workflows/test.yml"
281
- - ".gitignore"
282
280
  - ".rspec"
283
281
  - ".rubocop.yml"
284
282
  - ".simplecov"
285
283
  - Appraisals
284
+ - CHANGELOG.md
286
285
  - Gemfile
287
286
  - LICENSE.txt
288
287
  - README.md
@@ -293,6 +292,7 @@ files:
293
292
  - gemfiles/activerecord_5.2.gemfile
294
293
  - gemfiles/activerecord_6.0.gemfile
295
294
  - gemfiles/activerecord_6.1.gemfile
295
+ - gemfiles/activerecord_7.0.gemfile
296
296
  - lib/ridgepole.rb
297
297
  - lib/ridgepole/cli/config.rb
298
298
  - lib/ridgepole/client.rb
@@ -316,144 +316,7 @@ files:
316
316
  - lib/ridgepole/schema_statements_ext.rb
317
317
  - lib/ridgepole/version.rb
318
318
  - ridgepole.gemspec
319
- - spec/cli_helper.rb
320
- - spec/dsl_parser/context_spec.rb
321
- - spec/erb_helper.rb
322
- - spec/fixtures/for_require_relative_spec.rb
323
- - spec/hide_pending_formatter.rb
324
- - spec/mysql/_migrate/migrate_change_table_option_spec.rb
325
- - spec/mysql/bigint_pk/int_pk_spec.rb
326
- - spec/mysql/cli/config_spec.rb
327
- - spec/mysql/cli/ridgepole_spec.rb
328
- - spec/mysql/collation/collation_spec.rb
329
- - spec/mysql/comment/comment_spec.rb
330
- - spec/mysql/default_lambda/default_lambda_spec.rb
331
- - spec/mysql/diff/diff2_spec.rb
332
- - spec/mysql/diff/diff_spec.rb
333
- - spec/mysql/dump/dump_class_method_spec.rb
334
- - spec/mysql/dump/dump_some_tables_spec.rb
335
- - spec/mysql/dump/dump_spec.rb
336
- - spec/mysql/dump/dump_unknown_column_type_spec.rb
337
- - spec/mysql/dump/dump_without_table_options_spec.rb
338
- - spec/mysql/fk/migrate_change_fk2_spec.rb
339
- - spec/mysql/fk/migrate_change_fk_spec.rb
340
- - spec/mysql/fk/migrate_create_fk_spec.rb
341
- - spec/mysql/fk/migrate_drop_fk_spec.rb
342
- - spec/mysql/fk/migrate_fk_with_column_spec.rb
343
- - spec/mysql/fk/migrate_ignore_fk_spec.rb
344
- - spec/mysql/migrate/check_orphan_index_spec.rb
345
- - spec/mysql/migrate/migrate_add_column2_spec.rb
346
- - spec/mysql/migrate/migrate_add_column_order_spec.rb
347
- - spec/mysql/migrate/migrate_add_column_spec.rb
348
- - spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb
349
- - spec/mysql/migrate/migrate_add_column_with_script_spec.rb
350
- - spec/mysql/migrate/migrate_change_column2_spec.rb
351
- - spec/mysql/migrate/migrate_change_column3_spec.rb
352
- - spec/mysql/migrate/migrate_change_column4_spec.rb
353
- - spec/mysql/migrate/migrate_change_column5_spec.rb
354
- - spec/mysql/migrate/migrate_change_column6_spec.rb
355
- - spec/mysql/migrate/migrate_change_column7_spec.rb
356
- - spec/mysql/migrate/migrate_change_column8_spec.rb
357
- - spec/mysql/migrate/migrate_change_column_default_spec.rb
358
- - spec/mysql/migrate/migrate_change_column_float_spec.rb
359
- - spec/mysql/migrate/migrate_change_column_spec.rb
360
- - spec/mysql/migrate/migrate_change_index2_spec.rb
361
- - spec/mysql/migrate/migrate_change_index3_spec.rb
362
- - spec/mysql/migrate/migrate_change_index4_spec.rb
363
- - spec/mysql/migrate/migrate_change_index5_spec.rb
364
- - spec/mysql/migrate/migrate_change_index6_spec.rb
365
- - spec/mysql/migrate/migrate_change_index7_spec.rb
366
- - spec/mysql/migrate/migrate_change_index8_spec.rb
367
- - spec/mysql/migrate/migrate_change_index_spec.rb
368
- - spec/mysql/migrate/migrate_change_table_comment_spec.rb
369
- - spec/mysql/migrate/migrate_change_table_option_spec.rb
370
- - spec/mysql/migrate/migrate_check_relation_column_type_spec.rb
371
- - spec/mysql/migrate/migrate_create_index2_spec.rb
372
- - spec/mysql/migrate/migrate_create_index_spec.rb
373
- - spec/mysql/migrate/migrate_create_table_spec.rb
374
- - spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb
375
- - spec/mysql/migrate/migrate_create_table_with_index_spec.rb
376
- - spec/mysql/migrate/migrate_create_table_with_options_spec.rb
377
- - spec/mysql/migrate/migrate_create_table_with_script_spec.rb
378
- - spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb
379
- - spec/mysql/migrate/migrate_drop_column_and_index_spec.rb
380
- - spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb
381
- - spec/mysql/migrate/migrate_drop_column_spec.rb
382
- - spec/mysql/migrate/migrate_drop_index_spec.rb
383
- - spec/mysql/migrate/migrate_drop_table_spec.rb
384
- - spec/mysql/migrate/migrate_duplicate_index_spec.rb
385
- - spec/mysql/migrate/migrate_duplicate_table_spec.rb
386
- - spec/mysql/migrate/migrate_empty_spec.rb
387
- - spec/mysql/migrate/migrate_execute_spec.rb
388
- - spec/mysql/migrate/migrate_ignore_column_spec.rb
389
- - spec/mysql/migrate/migrate_ignore_index_spec.rb
390
- - spec/mysql/migrate/migrate_log_file_spec.rb
391
- - spec/mysql/migrate/migrate_merge_mode_spec.rb
392
- - spec/mysql/migrate/migrate_noop_spec.rb
393
- - spec/mysql/migrate/migrate_primary_key_spec.rb
394
- - spec/mysql/migrate/migrate_rename_column_spec.rb
395
- - spec/mysql/migrate/migrate_rename_table_spec.rb
396
- - spec/mysql/migrate/migrate_same_default_null_spec.rb
397
- - spec/mysql/migrate/migrate_same_spec.rb
398
- - spec/mysql/migrate/migrate_script_error_spec.rb
399
- - spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
400
- - spec/mysql/migrate/migrate_skip_drop_table_spec.rb
401
- - spec/mysql/migrate/migrate_skip_rename_column_spec.rb
402
- - spec/mysql/migrate/migrate_skip_rename_table_spec.rb
403
- - spec/mysql/migrate/migrate_with_ignore_tables_spec.rb
404
- - spec/mysql/migrate/migrate_with_pre_post_query_spec.rb
405
- - spec/mysql/migrate/migrate_with_tables_spec.rb
406
- - spec/mysql/migrate/migrate_with_verbose_log_spec.rb
407
- - spec/mysql/ridgepole_test_database.sql
408
- - spec/mysql/ridgepole_test_tables.sql
409
- - spec/mysql/ridgepole_test_tables_unknown_column_type.sql
410
- - spec/mysql/text_blob_types/text_blob_types_spec.rb
411
- - spec/mysql/~default_name_fk/migrate_change_fk_spec.rb
412
- - spec/mysql/~default_name_fk/migrate_create_fk_spec.rb
413
- - spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb
414
- - spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb
415
- - spec/mysql57/json/add_json_column_spec.rb
416
- - spec/mysql57/json/change_json_column_spec.rb
417
- - spec/mysql57/json/drop_json_column_spec.rb
418
- - spec/mysql57/virtual/add_virtual_column_spec.rb
419
- - spec/mysql57/virtual/change_virtual_column_spec.rb
420
- - spec/mysql57/virtual/drop_virtual_column_spec.rb
421
- - spec/postgresql/diff/diff_spec.rb
422
- - spec/postgresql/dump/dump_spec.rb
423
- - spec/postgresql/fk/migrate_change_fk_spec.rb
424
- - spec/postgresql/fk/migrate_create_fk_spec.rb
425
- - spec/postgresql/fk/migrate_drop_fk_spec.rb
426
- - spec/postgresql/migrate/migrate_add_column_spec.rb
427
- - spec/postgresql/migrate/migrate_add_expression_index_spec.rb
428
- - spec/postgresql/migrate/migrate_bigint_spec.rb
429
- - spec/postgresql/migrate/migrate_change_column_default_spec.rb
430
- - spec/postgresql/migrate/migrate_change_column_spec.rb
431
- - spec/postgresql/migrate/migrate_change_index_spec.rb
432
- - spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb
433
- - spec/postgresql/migrate/migrate_create_table_spec.rb
434
- - spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb
435
- - spec/postgresql/migrate/migrate_drop_column_spec.rb
436
- - spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb
437
- - spec/postgresql/migrate/migrate_drop_expression_index_spec.rb
438
- - spec/postgresql/migrate/migrate_drop_index_spec.rb
439
- - spec/postgresql/migrate/migrate_drop_table_spec.rb
440
- - spec/postgresql/migrate/migrate_ext_cols_spec.rb
441
- - spec/postgresql/migrate/migrate_primary_key2_spec.rb
442
- - spec/postgresql/migrate/migrate_primary_key_spec.rb
443
- - spec/postgresql/migrate/migrate_references_spec.rb
444
- - spec/postgresql/migrate/migrate_rename_column_spec.rb
445
- - spec/postgresql/migrate/migrate_rename_table_spec.rb
446
- - spec/postgresql/migrate/migrate_same_spec.rb
447
- - spec/postgresql/ridgepole_test_database.sql
448
- - spec/postgresql/ridgepole_test_tables.sql
449
- - spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb
450
- - spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb
451
- - spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb
452
- - spec/processing_for_ci.rb
453
- - spec/spec_condition.rb
454
- - spec/spec_const.rb
455
- - spec/spec_helper.rb
456
- homepage: https://github.com/winebarrel/ridgepole
319
+ homepage: https://github.com/ridgepole/ridgepole
457
320
  licenses:
458
321
  - MIT
459
322
  metadata: {}
@@ -472,145 +335,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
472
335
  - !ruby/object:Gem::Version
473
336
  version: '0'
474
337
  requirements: []
475
- rubygems_version: 3.0.3
338
+ rubygems_version: 3.2.32
476
339
  signing_key:
477
340
  specification_version: 4
478
341
  summary: Ridgepole is a tool to manage DB schema.
479
- test_files:
480
- - spec/cli_helper.rb
481
- - spec/dsl_parser/context_spec.rb
482
- - spec/erb_helper.rb
483
- - spec/fixtures/for_require_relative_spec.rb
484
- - spec/hide_pending_formatter.rb
485
- - spec/mysql/_migrate/migrate_change_table_option_spec.rb
486
- - spec/mysql/bigint_pk/int_pk_spec.rb
487
- - spec/mysql/cli/config_spec.rb
488
- - spec/mysql/cli/ridgepole_spec.rb
489
- - spec/mysql/collation/collation_spec.rb
490
- - spec/mysql/comment/comment_spec.rb
491
- - spec/mysql/default_lambda/default_lambda_spec.rb
492
- - spec/mysql/diff/diff2_spec.rb
493
- - spec/mysql/diff/diff_spec.rb
494
- - spec/mysql/dump/dump_class_method_spec.rb
495
- - spec/mysql/dump/dump_some_tables_spec.rb
496
- - spec/mysql/dump/dump_spec.rb
497
- - spec/mysql/dump/dump_unknown_column_type_spec.rb
498
- - spec/mysql/dump/dump_without_table_options_spec.rb
499
- - spec/mysql/fk/migrate_change_fk2_spec.rb
500
- - spec/mysql/fk/migrate_change_fk_spec.rb
501
- - spec/mysql/fk/migrate_create_fk_spec.rb
502
- - spec/mysql/fk/migrate_drop_fk_spec.rb
503
- - spec/mysql/fk/migrate_fk_with_column_spec.rb
504
- - spec/mysql/fk/migrate_ignore_fk_spec.rb
505
- - spec/mysql/migrate/check_orphan_index_spec.rb
506
- - spec/mysql/migrate/migrate_add_column2_spec.rb
507
- - spec/mysql/migrate/migrate_add_column_order_spec.rb
508
- - spec/mysql/migrate/migrate_add_column_spec.rb
509
- - spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb
510
- - spec/mysql/migrate/migrate_add_column_with_script_spec.rb
511
- - spec/mysql/migrate/migrate_change_column2_spec.rb
512
- - spec/mysql/migrate/migrate_change_column3_spec.rb
513
- - spec/mysql/migrate/migrate_change_column4_spec.rb
514
- - spec/mysql/migrate/migrate_change_column5_spec.rb
515
- - spec/mysql/migrate/migrate_change_column6_spec.rb
516
- - spec/mysql/migrate/migrate_change_column7_spec.rb
517
- - spec/mysql/migrate/migrate_change_column8_spec.rb
518
- - spec/mysql/migrate/migrate_change_column_default_spec.rb
519
- - spec/mysql/migrate/migrate_change_column_float_spec.rb
520
- - spec/mysql/migrate/migrate_change_column_spec.rb
521
- - spec/mysql/migrate/migrate_change_index2_spec.rb
522
- - spec/mysql/migrate/migrate_change_index3_spec.rb
523
- - spec/mysql/migrate/migrate_change_index4_spec.rb
524
- - spec/mysql/migrate/migrate_change_index5_spec.rb
525
- - spec/mysql/migrate/migrate_change_index6_spec.rb
526
- - spec/mysql/migrate/migrate_change_index7_spec.rb
527
- - spec/mysql/migrate/migrate_change_index8_spec.rb
528
- - spec/mysql/migrate/migrate_change_index_spec.rb
529
- - spec/mysql/migrate/migrate_change_table_comment_spec.rb
530
- - spec/mysql/migrate/migrate_change_table_option_spec.rb
531
- - spec/mysql/migrate/migrate_check_relation_column_type_spec.rb
532
- - spec/mysql/migrate/migrate_create_index2_spec.rb
533
- - spec/mysql/migrate/migrate_create_index_spec.rb
534
- - spec/mysql/migrate/migrate_create_table_spec.rb
535
- - spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb
536
- - spec/mysql/migrate/migrate_create_table_with_index_spec.rb
537
- - spec/mysql/migrate/migrate_create_table_with_options_spec.rb
538
- - spec/mysql/migrate/migrate_create_table_with_script_spec.rb
539
- - spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb
540
- - spec/mysql/migrate/migrate_drop_column_and_index_spec.rb
541
- - spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb
542
- - spec/mysql/migrate/migrate_drop_column_spec.rb
543
- - spec/mysql/migrate/migrate_drop_index_spec.rb
544
- - spec/mysql/migrate/migrate_drop_table_spec.rb
545
- - spec/mysql/migrate/migrate_duplicate_index_spec.rb
546
- - spec/mysql/migrate/migrate_duplicate_table_spec.rb
547
- - spec/mysql/migrate/migrate_empty_spec.rb
548
- - spec/mysql/migrate/migrate_execute_spec.rb
549
- - spec/mysql/migrate/migrate_ignore_column_spec.rb
550
- - spec/mysql/migrate/migrate_ignore_index_spec.rb
551
- - spec/mysql/migrate/migrate_log_file_spec.rb
552
- - spec/mysql/migrate/migrate_merge_mode_spec.rb
553
- - spec/mysql/migrate/migrate_noop_spec.rb
554
- - spec/mysql/migrate/migrate_primary_key_spec.rb
555
- - spec/mysql/migrate/migrate_rename_column_spec.rb
556
- - spec/mysql/migrate/migrate_rename_table_spec.rb
557
- - spec/mysql/migrate/migrate_same_default_null_spec.rb
558
- - spec/mysql/migrate/migrate_same_spec.rb
559
- - spec/mysql/migrate/migrate_script_error_spec.rb
560
- - spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb
561
- - spec/mysql/migrate/migrate_skip_drop_table_spec.rb
562
- - spec/mysql/migrate/migrate_skip_rename_column_spec.rb
563
- - spec/mysql/migrate/migrate_skip_rename_table_spec.rb
564
- - spec/mysql/migrate/migrate_with_ignore_tables_spec.rb
565
- - spec/mysql/migrate/migrate_with_pre_post_query_spec.rb
566
- - spec/mysql/migrate/migrate_with_tables_spec.rb
567
- - spec/mysql/migrate/migrate_with_verbose_log_spec.rb
568
- - spec/mysql/ridgepole_test_database.sql
569
- - spec/mysql/ridgepole_test_tables.sql
570
- - spec/mysql/ridgepole_test_tables_unknown_column_type.sql
571
- - spec/mysql/text_blob_types/text_blob_types_spec.rb
572
- - spec/mysql/~default_name_fk/migrate_change_fk_spec.rb
573
- - spec/mysql/~default_name_fk/migrate_create_fk_spec.rb
574
- - spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb
575
- - spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb
576
- - spec/mysql57/json/add_json_column_spec.rb
577
- - spec/mysql57/json/change_json_column_spec.rb
578
- - spec/mysql57/json/drop_json_column_spec.rb
579
- - spec/mysql57/virtual/add_virtual_column_spec.rb
580
- - spec/mysql57/virtual/change_virtual_column_spec.rb
581
- - spec/mysql57/virtual/drop_virtual_column_spec.rb
582
- - spec/postgresql/diff/diff_spec.rb
583
- - spec/postgresql/dump/dump_spec.rb
584
- - spec/postgresql/fk/migrate_change_fk_spec.rb
585
- - spec/postgresql/fk/migrate_create_fk_spec.rb
586
- - spec/postgresql/fk/migrate_drop_fk_spec.rb
587
- - spec/postgresql/migrate/migrate_add_column_spec.rb
588
- - spec/postgresql/migrate/migrate_add_expression_index_spec.rb
589
- - spec/postgresql/migrate/migrate_bigint_spec.rb
590
- - spec/postgresql/migrate/migrate_change_column_default_spec.rb
591
- - spec/postgresql/migrate/migrate_change_column_spec.rb
592
- - spec/postgresql/migrate/migrate_change_index_spec.rb
593
- - spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb
594
- - spec/postgresql/migrate/migrate_create_table_spec.rb
595
- - spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb
596
- - spec/postgresql/migrate/migrate_drop_column_spec.rb
597
- - spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb
598
- - spec/postgresql/migrate/migrate_drop_expression_index_spec.rb
599
- - spec/postgresql/migrate/migrate_drop_index_spec.rb
600
- - spec/postgresql/migrate/migrate_drop_table_spec.rb
601
- - spec/postgresql/migrate/migrate_ext_cols_spec.rb
602
- - spec/postgresql/migrate/migrate_primary_key2_spec.rb
603
- - spec/postgresql/migrate/migrate_primary_key_spec.rb
604
- - spec/postgresql/migrate/migrate_references_spec.rb
605
- - spec/postgresql/migrate/migrate_rename_column_spec.rb
606
- - spec/postgresql/migrate/migrate_rename_table_spec.rb
607
- - spec/postgresql/migrate/migrate_same_spec.rb
608
- - spec/postgresql/ridgepole_test_database.sql
609
- - spec/postgresql/ridgepole_test_tables.sql
610
- - spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb
611
- - spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb
612
- - spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb
613
- - spec/processing_for_ci.rb
614
- - spec/spec_condition.rb
615
- - spec/spec_const.rb
616
- - spec/spec_helper.rb
342
+ test_files: []
@@ -1,70 +0,0 @@
1
- name: test
2
-
3
- on:
4
- push:
5
- pull_request:
6
-
7
- jobs:
8
- build:
9
- runs-on: ubuntu-latest
10
- strategy:
11
- fail-fast: false
12
- matrix:
13
- ruby:
14
- - 2.4
15
- - 2.5
16
- - 2.6
17
- - 2.7
18
- env:
19
- - MYSQL56=1
20
- - MYSQL57=1
21
- - POSTGRESQL=1
22
- gemfile:
23
- - gemfiles/activerecord_5.1.gemfile
24
- - gemfiles/activerecord_5.2.gemfile
25
- - gemfiles/activerecord_6.0.gemfile
26
- - gemfiles/activerecord_6.1.gemfile
27
- exclude:
28
- - ruby: 2.4
29
- gemfile: gemfiles/activerecord_6.0.gemfile
30
- - ruby: 2.4
31
- gemfile: gemfiles/activerecord_6.1.gemfile
32
- env:
33
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
34
- steps:
35
- - uses: actions/checkout@v2
36
- - uses: ruby/setup-ruby@v1
37
- with:
38
- ruby-version: ${{ matrix.ruby }}
39
- bundler-cache: true
40
- - name: Setup dependencies
41
- run: |
42
- for i in {1..60}; do docker-compose up -d && break; sleep 1; done
43
- # Wait until database servers start
44
- function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 ping --ssl-mode=DISABLED; }
45
- function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 ping --ssl-mode=DISABLED; }
46
- function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; }
47
- for i in {1..60}; do mysql_ping && break; sleep 1; done
48
- for i in {1..60}; do mysql57_ping && break; sleep 1; done
49
- for i in {1..60}; do pg_ping && break; sleep 1; done
50
- env:
51
- MYSQL_PWD: password
52
- - name: Run tests
53
- run: ${{ matrix.env }} bundle exec rake
54
- env:
55
- BUNDLE_GEMFILE: ${{ matrix.gemfile }}
56
- - name: Coveralls Parallel
57
- uses: coverallsapp/github-action@v1.1.2
58
- with:
59
- github-token: ${{ secrets.GITHUB_TOKEN }}
60
- flag-name: run-${{ matrix.ruby }}-${{ matrix.env }}-${{ matrix.gemfile }}
61
- parallel: true
62
- finish:
63
- needs: build
64
- runs-on: ubuntu-latest
65
- steps:
66
- - name: Coveralls Finished
67
- uses: coverallsapp/github-action@v1.1.2
68
- with:
69
- github-token: ${{ secrets.GITHUB_TOKEN }}
70
- parallel-finished: true
data/.gitignore DELETED
@@ -1,25 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- .DS_Store
19
- test.rb
20
- Schemafile
21
- *.schema
22
- _site/
23
- config.yml
24
- /gemfiles/*.lock
25
- *.swp
data/spec/cli_helper.rb DELETED
@@ -1,65 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- module CLIHelper
4
- def default_cli_hook
5
- <<-RUBY.strip_heredoc
6
- require 'ridgepole'
7
-
8
- class Ridgepole::Delta
9
- def initialize(*args);
10
- end
11
- def migrate(*args)
12
- puts "Ridgepole::Delta#migrate"
13
- [#{differ}, "create_table :table do\\nend"]
14
- end
15
- def script
16
- puts "Ridgepole::Delta#script"
17
-
18
- "create_table :table do\\nend"
19
- end
20
- def differ?
21
- puts "Ridgepole::Delta#differ?"
22
- #{differ}
23
- end
24
- end
25
-
26
- class Ridgepole::Client
27
- def initialize(*args)
28
- puts "Ridgepole::Client#initialize([\#{args.map {|i| i.kind_of?(File) ? i.path : i.inspect}.join(', ')}])"
29
- end
30
- def dump
31
- puts "Ridgepole::Client#dump"
32
- end
33
- def diff(*args)
34
- puts "Ridgepole::Client#diff"
35
- Ridgepole::Delta.new
36
- end
37
- class << self
38
- def diff(*args)
39
- puts "Ridgepole::Client.diff([\#{args.map {|i| i.kind_of?(File) ? i.path : i.inspect}.join(', ')}])"
40
- Ridgepole::Delta.new
41
- end
42
- def dump(args)
43
- puts "Ridgepole::Client.dump"
44
- end
45
- end
46
- end
47
- RUBY
48
- end
49
-
50
- def run_cli(options = {})
51
- args = options[:args] || []
52
- hook = options[:hook] || default_cli_hook
53
- path = File.expand_path('../bin/ridgepole', __dir__)
54
-
55
- Tempfile.open(["#{File.basename __FILE__}.#{$PROCESS_ID}", '.rb']) do |f|
56
- f.puts(hook)
57
- f.puts(File.read(path))
58
- f.flush
59
-
60
- cmd = ([:ruby, f.path] + args).join(' ')
61
- Open3.capture2e(cmd)
62
- end
63
- end
64
- end
65
- include CLIHelper
@@ -1,16 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe Ridgepole::DSLParser::Context do
4
- describe '#require_relative' do
5
- subject { context.require_relative(relative_path) }
6
-
7
- let!(:context) do
8
- Ridgepole::DSLParser::Context.new
9
- end
10
- let!(:relative_path) do
11
- '../fixtures/for_require_relative_spec.rb'
12
- end
13
-
14
- it { is_expected.to be_truthy }
15
- end
16
- end
data/spec/erb_helper.rb DELETED
@@ -1,26 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- include ERBh
4
-
5
- ERBh.define_method(:i) do |obj|
6
- if obj.nil? || (obj.respond_to?(:empty?) && obj.empty?)
7
- @_erbout.sub!(/,\s*\z/, '')
8
- ''
9
- elsif obj.is_a?(Hash)
10
- obj.modern_inspect_without_brace
11
- else
12
- obj
13
- end
14
- end
15
-
16
- ERBh.define_method(:cond) do |conds, m, e = nil|
17
- if condition(conds)
18
- m
19
- else
20
- e || (begin
21
- m.class.new
22
- rescue StandardError
23
- nil
24
- end)
25
- end
26
- end
@@ -1,3 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- 'This file is used by dsl_parser/context_spec.'
@@ -1,9 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- class HidePendingFormatter < RSpec::Core::Formatters::ProgressFormatter
4
- RSpec::Core::Formatters.register self, :example_pending
5
- RSpec::Core::Formatters.register self, :dump_pending
6
- def example_pending(notification); end
7
-
8
- def dump_pending(notification); end
9
- end
@@ -1,40 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Ridgepole::Client#diff -> migrate' do
4
- context 'when change mysql table options' do
5
- let(:actual_dsl) do
6
- erbh(<<-ERB)
7
- create_table "employees", primary_key: "emp_no", force: :cascade, <%= i cond(">= 6.1", { charset: "utf8", options: "ENGINE=MyISAM" }, { options: "ENGINE=MyISAM DEFAULT CHARSET=utf8" }) %> do |t|
8
- t.date "birth_date", null: false
9
- t.string "first_name", limit: 14, null: false
10
- t.string "last_name", limit: 16, null: false
11
- t.string "gender", limit: 1, null: false
12
- t.date "hire_date", null: false
13
- end
14
- ERB
15
- end
16
-
17
- let(:expected_dsl) do
18
- erbh(<<-ERB)
19
- create_table "employees", primary_key: "emp_no", force: :cascade, <%= i cond(">= 6.1", { charset: "ascii" }, { options: "ENGINE=InnoDB DEFAULT CHARSET=ascii" }) %> do |t|
20
- t.date "birth_date", null: false
21
- t.string "first_name", limit: 14, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
22
- t.string "last_name", limit: 16, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
23
- t.string "gender", limit: 1, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
24
- t.date "hire_date", null: false
25
- end
26
- ERB
27
- end
28
-
29
- before { subject.diff(actual_dsl).migrate }
30
- subject { client(dump_without_table_options: false, mysql_change_table_options: true) }
31
-
32
- it {
33
- delta = subject.diff(expected_dsl)
34
- expect(delta.differ?).to be_truthy
35
- expect(subject.dump).to match_ruby actual_dsl
36
- delta.migrate
37
- expect(subject.dump).to match_ruby expected_dsl
38
- }
39
- end
40
- end
@@ -1,47 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- describe 'Ridgepole::Client (with integer pk)' do
4
- context 'when with id:integer' do
5
- let(:dsl) do
6
- <<-RUBY
7
- create_table "books", id: :integer, force: :cascade do |t|
8
- t.string "title", null: false
9
- t.integer "author_id", null: false
10
- t.datetime "created_at"
11
- t.datetime "updated_at"
12
- end
13
- RUBY
14
- end
15
-
16
- subject { client }
17
-
18
- before { subject.diff(dsl).migrate }
19
-
20
- specify do
21
- expect(show_create_table(:books)).to include '`id` int(11) NOT NULL AUTO_INCREMENT'
22
- expect(subject.dump).to match_ruby dsl
23
- end
24
- end
25
-
26
- context 'when without id:integer' do
27
- let(:dsl) do
28
- <<-RUBY
29
- create_table "books", force: :cascade do |t|
30
- t.string "title", null: false
31
- t.integer "author_id", null: false
32
- t.datetime "created_at"
33
- t.datetime "updated_at"
34
- end
35
- RUBY
36
- end
37
-
38
- subject { client }
39
-
40
- before { subject.diff(dsl).migrate }
41
-
42
- specify do
43
- expect(show_create_table(:books)).to include '`id` bigint(20) NOT NULL AUTO_INCREMENT'
44
- expect(subject.dump).to match_ruby dsl
45
- end
46
- end
47
- end