ridgepole 0.7.8 → 0.8.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (168) hide show
  1. checksums.yaml +4 -4
  2. data/.rspec +1 -1
  3. data/.rubocop.yml +1 -3
  4. data/.travis.yml +11 -3
  5. data/Appraisals +4 -2
  6. data/Gemfile +0 -2
  7. data/README.md +3 -4
  8. data/Rakefile +0 -2
  9. data/bin/ridgepole +2 -4
  10. data/gemfiles/activerecord_6.0.gemfile +7 -0
  11. data/lib/ridgepole.rb +0 -2
  12. data/lib/ridgepole/cli/config.rb +0 -2
  13. data/lib/ridgepole/client.rb +0 -2
  14. data/lib/ridgepole/connection_adapters.rb +0 -2
  15. data/lib/ridgepole/default_limit.rb +0 -2
  16. data/lib/ridgepole/delta.rb +1 -3
  17. data/lib/ridgepole/diff.rb +2 -4
  18. data/lib/ridgepole/dsl_parser.rb +0 -2
  19. data/lib/ridgepole/dsl_parser/context.rb +3 -5
  20. data/lib/ridgepole/dsl_parser/table_definition.rb +0 -2
  21. data/lib/ridgepole/dumper.rb +0 -2
  22. data/lib/ridgepole/execute_expander.rb +2 -4
  23. data/lib/ridgepole/ext/abstract_adapter/disable_table_options.rb +0 -2
  24. data/lib/ridgepole/ext/abstract_mysql_adapter/dump_auto_increment.rb +0 -2
  25. data/lib/ridgepole/ext/abstract_mysql_adapter/use_alter_index.rb +0 -2
  26. data/lib/ridgepole/ext/pp_sort_hash.rb +0 -2
  27. data/lib/ridgepole/ext/schema_dumper.rb +0 -2
  28. data/lib/ridgepole/external_sql_executer.rb +0 -2
  29. data/lib/ridgepole/logger.rb +0 -2
  30. data/lib/ridgepole/migration_ext.rb +0 -2
  31. data/lib/ridgepole/schema_dumper_ext.rb +0 -2
  32. data/lib/ridgepole/schema_statements_ext.rb +0 -2
  33. data/lib/ridgepole/version.rb +1 -3
  34. data/ridgepole.gemspec +0 -2
  35. data/spec/cli_helper.rb +0 -2
  36. data/spec/erb_helper.rb +0 -2
  37. data/spec/hide_pending_formatter.rb +0 -2
  38. data/spec/mysql/_migrate/migrate_change_table_option_spec.rb +3 -5
  39. data/spec/mysql/bigint_pk/bigint_pk_spec.rb +0 -2
  40. data/spec/mysql/bigint_pk/int_pk_spec.rb +0 -2
  41. data/spec/mysql/cli/config_spec.rb +0 -2
  42. data/spec/mysql/cli/ridgepole_spec.rb +0 -2
  43. data/spec/mysql/collation/collation_spec.rb +0 -2
  44. data/spec/mysql/comment/comment_spec.rb +0 -2
  45. data/spec/mysql/default_lambda/default_lambda_spec.rb +0 -2
  46. data/spec/mysql/diff/diff2_spec.rb +0 -2
  47. data/spec/mysql/diff/diff_spec.rb +0 -2
  48. data/spec/mysql/dump/dump_class_method_spec.rb +0 -2
  49. data/spec/mysql/dump/dump_some_tables_spec.rb +0 -2
  50. data/spec/mysql/dump/dump_spec.rb +0 -2
  51. data/spec/mysql/dump/dump_unknown_column_type_spec.rb +0 -2
  52. data/spec/mysql/dump/dump_without_table_options_spec.rb +0 -2
  53. data/spec/mysql/fk/migrate_change_fk2_spec.rb +0 -2
  54. data/spec/mysql/fk/migrate_change_fk_spec.rb +0 -2
  55. data/spec/mysql/fk/migrate_create_fk_spec.rb +0 -2
  56. data/spec/mysql/fk/migrate_drop_fk_spec.rb +0 -2
  57. data/spec/mysql/fk/migrate_ignore_fk_spec.rb +0 -2
  58. data/spec/mysql/migrate/check_orphan_index_spec.rb +0 -2
  59. data/spec/mysql/migrate/migrate_add_column2_spec.rb +0 -2
  60. data/spec/mysql/migrate/migrate_add_column_order_spec.rb +0 -2
  61. data/spec/mysql/migrate/migrate_add_column_spec.rb +0 -2
  62. data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +0 -2
  63. data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +0 -2
  64. data/spec/mysql/migrate/migrate_change_column2_spec.rb +0 -2
  65. data/spec/mysql/migrate/migrate_change_column3_spec.rb +0 -2
  66. data/spec/mysql/migrate/migrate_change_column4_spec.rb +0 -2
  67. data/spec/mysql/migrate/migrate_change_column5_spec.rb +0 -2
  68. data/spec/mysql/migrate/migrate_change_column6_spec.rb +0 -2
  69. data/spec/mysql/migrate/migrate_change_column7_spec.rb +0 -2
  70. data/spec/mysql/migrate/migrate_change_column8_spec.rb +0 -2
  71. data/spec/mysql/migrate/migrate_change_column_default_spec.rb +0 -2
  72. data/spec/mysql/migrate/migrate_change_column_float_spec.rb +0 -2
  73. data/spec/mysql/migrate/migrate_change_column_spec.rb +0 -2
  74. data/spec/mysql/migrate/migrate_change_index2_spec.rb +0 -2
  75. data/spec/mysql/migrate/migrate_change_index3_spec.rb +0 -2
  76. data/spec/mysql/migrate/migrate_change_index4_spec.rb +0 -2
  77. data/spec/mysql/migrate/migrate_change_index5_spec.rb +0 -2
  78. data/spec/mysql/migrate/migrate_change_index6_spec.rb +0 -2
  79. data/spec/mysql/migrate/migrate_change_index7_spec.rb +0 -2
  80. data/spec/mysql/migrate/migrate_change_index8_spec.rb +0 -2
  81. data/spec/mysql/migrate/migrate_change_index_spec.rb +0 -2
  82. data/spec/mysql/migrate/migrate_change_table_comment_spec.rb +0 -2
  83. data/spec/mysql/migrate/migrate_change_table_option_spec.rb +0 -2
  84. data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +0 -2
  85. data/spec/mysql/migrate/migrate_create_index2_spec.rb +0 -2
  86. data/spec/mysql/migrate/migrate_create_index_spec.rb +0 -2
  87. data/spec/mysql/migrate/migrate_create_table_spec.rb +0 -2
  88. data/spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb +0 -2
  89. data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +0 -2
  90. data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +0 -2
  91. data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +0 -2
  92. data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +0 -2
  93. data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +0 -2
  94. data/spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb +0 -2
  95. data/spec/mysql/migrate/migrate_drop_column_spec.rb +0 -2
  96. data/spec/mysql/migrate/migrate_drop_index_spec.rb +0 -2
  97. data/spec/mysql/migrate/migrate_drop_table_spec.rb +0 -2
  98. data/spec/mysql/migrate/migrate_duplicate_index_spec.rb +0 -2
  99. data/spec/mysql/migrate/migrate_duplicate_table_spec.rb +0 -2
  100. data/spec/mysql/migrate/migrate_empty_spec.rb +0 -2
  101. data/spec/mysql/migrate/migrate_execute_spec.rb +0 -2
  102. data/spec/mysql/migrate/migrate_ignore_column_spec.rb +0 -2
  103. data/spec/mysql/migrate/migrate_ignore_index_spec.rb +0 -2
  104. data/spec/mysql/migrate/migrate_log_file_spec.rb +0 -2
  105. data/spec/mysql/migrate/migrate_merge_mode_spec.rb +0 -2
  106. data/spec/mysql/migrate/migrate_noop_spec.rb +0 -2
  107. data/spec/mysql/migrate/migrate_primary_key_spec.rb +0 -2
  108. data/spec/mysql/migrate/migrate_rename_column_spec.rb +0 -2
  109. data/spec/mysql/migrate/migrate_rename_table_spec.rb +0 -2
  110. data/spec/mysql/migrate/migrate_same_default_null_spec.rb +0 -2
  111. data/spec/mysql/migrate/migrate_same_spec.rb +0 -2
  112. data/spec/mysql/migrate/migrate_script_error_spec.rb +0 -2
  113. data/spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb +0 -2
  114. data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +0 -2
  115. data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +0 -2
  116. data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +0 -2
  117. data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +0 -2
  118. data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +0 -2
  119. data/spec/mysql/migrate/migrate_with_tables_spec.rb +0 -2
  120. data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +0 -2
  121. data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +0 -2
  122. data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +0 -2
  123. data/spec/mysql/text_blob_types/text_blob_types_spec.rb +50 -10
  124. data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +0 -2
  125. data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +0 -2
  126. data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +0 -2
  127. data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +0 -2
  128. data/spec/mysql57/json/add_json_column_spec.rb +0 -2
  129. data/spec/mysql57/json/change_json_column_spec.rb +0 -2
  130. data/spec/mysql57/json/drop_json_column_spec.rb +0 -2
  131. data/spec/mysql57/virtual/add_virtual_column_spec.rb +0 -2
  132. data/spec/mysql57/virtual/change_virtual_column_spec.rb +0 -2
  133. data/spec/mysql57/virtual/drop_virtual_column_spec.rb +0 -2
  134. data/spec/postgresql/diff/diff_spec.rb +0 -2
  135. data/spec/postgresql/dump/dump_spec.rb +0 -2
  136. data/spec/postgresql/fk/migrate_change_fk_spec.rb +0 -2
  137. data/spec/postgresql/fk/migrate_create_fk_spec.rb +0 -2
  138. data/spec/postgresql/fk/migrate_drop_fk_spec.rb +0 -2
  139. data/spec/postgresql/migrate/migrate_add_column_spec.rb +0 -2
  140. data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +0 -2
  141. data/spec/postgresql/migrate/migrate_bigint_spec.rb +0 -2
  142. data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +0 -2
  143. data/spec/postgresql/migrate/migrate_change_column_spec.rb +0 -2
  144. data/spec/postgresql/migrate/migrate_change_index_spec.rb +0 -2
  145. data/spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb +0 -2
  146. data/spec/postgresql/migrate/migrate_create_table_spec.rb +0 -2
  147. data/spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb +0 -2
  148. data/spec/postgresql/migrate/migrate_drop_column_spec.rb +0 -2
  149. data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +0 -2
  150. data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +0 -2
  151. data/spec/postgresql/migrate/migrate_drop_index_spec.rb +0 -2
  152. data/spec/postgresql/migrate/migrate_drop_table_spec.rb +0 -2
  153. data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +0 -2
  154. data/spec/postgresql/migrate/migrate_primary_key2_spec.rb +0 -2
  155. data/spec/postgresql/migrate/migrate_primary_key_spec.rb +0 -2
  156. data/spec/postgresql/migrate/migrate_references_spec.rb +0 -2
  157. data/spec/postgresql/migrate/migrate_rename_column_spec.rb +0 -2
  158. data/spec/postgresql/migrate/migrate_rename_table_spec.rb +0 -2
  159. data/spec/postgresql/migrate/migrate_same_spec.rb +0 -2
  160. data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +0 -2
  161. data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +0 -2
  162. data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +0 -2
  163. data/spec/processing_for_travis.rb +0 -2
  164. data/spec/spec_condition.rb +0 -2
  165. data/spec/spec_const.rb +7 -9
  166. data/spec/spec_helper.rb +0 -2
  167. metadata +6 -7
  168. data/spec/mysql/fk/migrate_fk_with_column_spec.rb +0 -163
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 539602e5232c6d1a295f937ff1fd26d51b830c68d8f185da876b1bedd95decfa
4
- data.tar.gz: b3c43db2efc39c4d93117bcc4ea5397928396e391c95aa5d9cb7c5db02bcd504
3
+ metadata.gz: 51752811fa355ec8328988d3f2b78f5eaa972379763e56498d7a9d8130e72b7c
4
+ data.tar.gz: 0e7dc4410a0c90fadc8c49d17292f947dfb14740cd89556e00420712a667ee79
5
5
  SHA512:
6
- metadata.gz: a66a60e376e529fae24fc91823e09e74812f0a476b6f63655cd69ec32edbf34907a9dce5a53d3add7446255a21ddac3452dc1ab17653bd6ac3e2c5be498f63fa
7
- data.tar.gz: b70c61a6f678547799517a053dd2946dd1480d61c9f9c0f09627e72956de042ff0cec31be74c5b763ab10e1dba1ea22454eb91949f149066f89c9674c6f85371
6
+ metadata.gz: cec836a87f959d8ded39667c3e726c9c11756fa20a03e75d9082cb5e7325ecb75aa6e4faf4660ad08615d333e50f8799157228b60fed4f176480656e9b0c9d46
7
+ data.tar.gz: e1dd85e686cf7ebf3bee192e2ac26f1f533f935a9e0c286ab6717badd288572325fe6dca5fb8393d94d8c138407a5ca4718480274cd6c4d618ffe01b411ea196
data/.rspec CHANGED
@@ -1,3 +1,3 @@
1
- --color
1
+ --colour
2
2
  --require spec_helper
3
3
  --format HidePendingFormatter
data/.rubocop.yml CHANGED
@@ -2,7 +2,7 @@ AllCops:
2
2
  Exclude:
3
3
  - 'gemfiles/**/*'
4
4
  - 'omnibus-ridgepole/**/*'
5
- TargetRubyVersion: 2.4
5
+ TargetRubyVersion: 2.2
6
6
  Bundler/OrderedGems:
7
7
  Include:
8
8
  - 'Appraisals'
@@ -39,5 +39,3 @@ Style/TrailingCommaInHashLiteral:
39
39
  EnforcedStyleForMultiline: consistent_comma
40
40
  Layout/ClosingHeredocIndentation:
41
41
  Enabled: false
42
- Style/NumericPredicate:
43
- Enabled: false
data/.travis.yml CHANGED
@@ -6,9 +6,10 @@ cache:
6
6
  - bundler
7
7
  - apt
8
8
  rvm:
9
- - 2.4.6
10
- - 2.5.5
11
- - 2.6.3
9
+ - 2.3.8
10
+ - 2.4.5
11
+ - 2.5.3
12
+ - 2.6.0
12
13
  before_script:
13
14
  - sudo service mysql stop
14
15
  - sudo service postgresql stop
@@ -25,6 +26,7 @@ gemfile:
25
26
  - gemfiles/activerecord_5.0.gemfile
26
27
  - gemfiles/activerecord_5.1.gemfile
27
28
  - gemfiles/activerecord_5.2.gemfile
29
+ - gemfiles/activerecord_6.0.gemfile
28
30
  env:
29
31
  matrix:
30
32
  - MYSQL56=1
@@ -38,3 +40,9 @@ addons:
38
40
  - mysql-client-core-5.6
39
41
  - mysql-client-5.6
40
42
  - postgresql-client-9.4
43
+ matrix:
44
+ exclude:
45
+ - rvm: 2.3.8
46
+ gemfile: gemfiles/activerecord_6.0.gemfile
47
+ - rvm: 2.4.5
48
+ gemfile: gemfiles/activerecord_6.0.gemfile
data/Appraisals CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  appraise 'activerecord-5.0' do
4
2
  gem 'activerecord', '~> 5.0.1'
5
3
  gem 'pg', '< 1.0.0'
@@ -13,3 +11,7 @@ appraise 'activerecord-5.2' do
13
11
  gem 'activerecord', '~> 5.2.0'
14
12
  gem 'mysql2', '~> 0.4.4'
15
13
  end
14
+
15
+ appraise 'activerecord-6.0' do
16
+ gem 'activerecord', '~> 6.0.0.rc1'
17
+ end
data/Gemfile CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  source 'https://rubygems.org'
4
2
 
5
3
  # Specify your gem's dependencies in ridgepole.gemspec
data/README.md CHANGED
@@ -5,8 +5,9 @@ Ridgepole is a tool to manage DB schema.
5
5
  It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.html#types-of-schema-dumps), and updates DB schema according to DSL.
6
6
  (like Chef/Puppet)
7
7
 
8
- [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)
9
- [![Unstable Version](https://img.shields.io/badge/unstable-0.8.0.rc1-green.svg?longCache=true&style=flat)](https://rubygems.org/gems/ridgepole/versions/0.8.0.rc1)
8
+ [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)<!--
9
+ [![Unstable Version](https://img.shields.io/badge/unstable-0.7.5.beta2-green.svg?longCache=true&style=flat)](https://rubygems.org/gems/ridgepole/versions/0.7.5.beta2)
10
+ -->
10
11
  [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.7)](https://travis-ci.org/winebarrel/ridgepole)
11
12
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.7)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
12
13
 
@@ -98,8 +99,6 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
98
99
  * Add ignore option ([pull#267](https://github.com/winebarrel/ridgepole/pull/267))
99
100
  * `>= 0.7.7`
100
101
  * Support URI query string ([pull#273](https://github.com/winebarrel/ridgepole/pull/273))
101
- * `>= 0.7.8`
102
- * Fix for `add_foreign_key(..., column: ,,,)` ([pull#278](https://github.com/winebarrel/ridgepole/pull/278))
103
102
  </details>
104
103
 
105
104
  ## Installation
data/Rakefile CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'bundler/gem_tasks'
4
2
  require 'rspec/core/rake_task'
5
3
  require 'rubocop/rake_task'
data/bin/ridgepole CHANGED
@@ -1,6 +1,4 @@
1
1
  #!/usr/bin/env ruby
2
- # frozen_string_literal: true
3
-
4
2
  $LOAD_PATH << File.expand_path('../lib', __dir__)
5
3
  require 'yaml'
6
4
  require 'optparse'
@@ -12,9 +10,9 @@ $stdout.sync = true
12
10
  $stderr.sync = true
13
11
 
14
12
  Version = Ridgepole::VERSION
15
- DEFAULT_FILENAME = 'Schemafile'
13
+ DEFAULT_FILENAME = 'Schemafile'.freeze
16
14
 
17
- MAGIC_COMMENT = <<-RUBY
15
+ MAGIC_COMMENT = <<-RUBY.freeze
18
16
  # -*- mode: ruby -*-
19
17
  # vi: set ft=ruby :
20
18
  RUBY
@@ -0,0 +1,7 @@
1
+ # This file was generated by Appraisal
2
+
3
+ source "https://rubygems.org"
4
+
5
+ gem "activerecord", "~> 6.0.0.rc1"
6
+
7
+ gemspec path: "../"
data/lib/ridgepole.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'logger'
4
2
  require 'open3'
5
3
  require 'pp'
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'erb'
4
2
  require 'yaml'
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class Client
5
3
  def initialize(conn_spec, options = {})
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class ConnectionAdapters
5
3
  def self.mysql?
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class DefaultsLimit
5
3
  DEFAULTS_LIMITS = {
@@ -1,8 +1,6 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class Delta
5
- SCRIPT_NAME = '<Schema>'
3
+ SCRIPT_NAME = '<Schema>'.freeze
6
4
 
7
5
  def initialize(delta, options = {})
8
6
  @delta = delta
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class Diff
5
3
  PRIMARY_KEY_OPTIONS = %i[id limit default null precision scale collation unsigned].freeze
@@ -351,9 +349,9 @@ module Ridgepole
351
349
  end
352
350
 
353
351
  def target?(table_name)
354
- if @options[:tables]&.include?(table_name)
352
+ if @options[:tables] && @options[:tables].include?(table_name)
355
353
  true
356
- elsif @options[:ignore_tables]&.any? { |i| i =~ table_name }
354
+ elsif @options[:ignore_tables] && @options[:ignore_tables].any? { |i| i =~ table_name }
357
355
  false
358
356
  elsif @options[:tables]
359
357
  false
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class DSLParser
5
3
  def initialize(options = {})
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class DSLParser
5
3
  class Context
@@ -28,7 +26,7 @@ module Ridgepole
28
26
  table_name = table_name.to_s
29
27
  table_definition = TableDefinition.new(table_name, self)
30
28
 
31
- options[:primary_key] = options[:primary_key].to_s if options[:primary_key]&.is_a?(Symbol)
29
+ options[:primary_key] = options[:primary_key].to_s if options[:primary_key] && options[:primary_key].is_a?(Symbol)
32
30
  if options[:id] && TableDefinition::ALIAS_TYPES.key?(options[:id])
33
31
  type, type_default_opts = TableDefinition::ALIAS_TYPES[options[:id]]
34
32
  options[:id] = type
@@ -82,7 +80,7 @@ module Ridgepole
82
80
  options[:column] = options[:column].to_s if options[:column]
83
81
  @__definition[from_table] ||= {}
84
82
  @__definition[from_table][:foreign_keys] ||= {}
85
- idx = options[:name] || [from_table, to_table, options[:column]]
83
+ idx = options[:name] || [from_table, to_table]
86
84
 
87
85
  raise "Foreign Key `#{from_table}(#{idx})` already defined" if @__definition[from_table][:foreign_keys][idx]
88
86
 
@@ -93,7 +91,7 @@ module Ridgepole
93
91
  end
94
92
 
95
93
  def require(file)
96
- schemafile = %r{\A/}.match?(file) ? file : File.join(@__working_dir, file)
94
+ schemafile = file =~ %r{\A/} ? file : File.join(@__working_dir, file)
97
95
 
98
96
  if File.exist?(schemafile)
99
97
  instance_eval(File.read(schemafile), schemafile)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class DSLParser
5
3
  class TableDefinition
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class Dumper
5
3
  def initialize(options = {})
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class ExecuteExpander
5
3
  class Stub
@@ -20,7 +18,7 @@ module Ridgepole
20
18
  callback.call(sql, name)
21
19
  end
22
20
 
23
- if /\A(SELECT|SHOW)\b/i.match?(sql)
21
+ if sql =~ /\A(SELECT|SHOW)\b/i
24
22
  begin
25
23
  super(sql, name)
26
24
  rescue StandardError
@@ -30,7 +28,7 @@ module Ridgepole
30
28
  Stub.new
31
29
  end
32
30
  elsif Ridgepole::ExecuteExpander.use_script
33
- if /\A(SELECT|SHOW)\b/i.match?(sql)
31
+ if sql =~ /\A(SELECT|SHOW)\b/i
34
32
  super(sql, name)
35
33
  else
36
34
  sql = append_alter_extra(sql)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/connection_adapters/abstract_adapter'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/connection_adapters/abstract_mysql_adapter'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/connection_adapters/abstract_mysql_adapter'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  module Ext
5
3
  module PpSortHash
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/schema_dumper'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class ExternalSqlExecuter
5
3
  def initialize(script, logger)
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
2
  class Logger < ::Logger
5
3
  include Singleton
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/migration'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/schema_dumper'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  require 'active_record/connection_adapters/abstract/schema_statements'
4
2
 
5
3
  module Ridgepole
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module Ridgepole
4
- VERSION = '0.7.8'
2
+ VERSION = '0.8.0.rc1'.freeze
5
3
  end
data/ridgepole.gemspec CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  lib = File.expand_path('lib', __dir__)
4
2
  $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
3
  require 'ridgepole/version'
data/spec/cli_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  module CLIHelper
4
2
  def default_cli_hook
5
3
  <<-RUBY.strip_heredoc
data/spec/erb_helper.rb CHANGED
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  include ERBh
4
2
 
5
3
  ERBh.define_method(:i) do |obj|
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  class HidePendingFormatter < RSpec::Core::Formatters::ProgressFormatter
4
2
  RSpec::Core::Formatters.register self, :example_pending
5
3
  RSpec::Core::Formatters.register self, :dump_pending
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  describe 'Ridgepole::Client#diff -> migrate' do
4
2
  context 'when change mysql table options' do
5
3
  let(:actual_dsl) do
@@ -18,9 +16,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
18
16
  erbh(<<-ERB)
19
17
  create_table "employees", primary_key: "emp_no", force: :cascade, options: "ENGINE=InnoDB DEFAULT CHARSET=ascii" do |t|
20
18
  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") %>
19
+ t.string "first_name", limit: 14, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
20
+ t.string "last_name", limit: 16, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
21
+ t.string "gender", limit: 1, null: false, <%= i cond('>= 5.2', collation: "utf8_general_ci") %>
24
22
  t.date "hire_date", null: false
25
23
  end
26
24
  ERB
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  describe 'Ridgepole::Client (with bigint pk)', condition: 5.0 do
4
2
  let(:id_primary_key_create_table) do
5
3
  <<-RUBY
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  describe 'Ridgepole::Client (with integer pk)', condition: '>= 5.1.0' do
4
2
  context 'when with id:integer' do
5
3
  let(:dsl) do
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  describe Ridgepole::Config do
4
2
  subject { Ridgepole::Config.load(config, env) }
5
3
 
@@ -1,5 +1,3 @@
1
- # frozen_string_literal: true
2
-
3
1
  describe 'ridgepole' do
4
2
  let(:differ) { false }
5
3
  let(:conf) { "'" + JSON.dump(conn_spec) + "'" }