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.
- checksums.yaml +4 -4
- data/.rspec +1 -1
- data/.rubocop.yml +1 -3
- data/.travis.yml +11 -3
- data/Appraisals +4 -2
- data/Gemfile +0 -2
- data/README.md +3 -4
- data/Rakefile +0 -2
- data/bin/ridgepole +2 -4
- data/gemfiles/activerecord_6.0.gemfile +7 -0
- data/lib/ridgepole.rb +0 -2
- data/lib/ridgepole/cli/config.rb +0 -2
- data/lib/ridgepole/client.rb +0 -2
- data/lib/ridgepole/connection_adapters.rb +0 -2
- data/lib/ridgepole/default_limit.rb +0 -2
- data/lib/ridgepole/delta.rb +1 -3
- data/lib/ridgepole/diff.rb +2 -4
- data/lib/ridgepole/dsl_parser.rb +0 -2
- data/lib/ridgepole/dsl_parser/context.rb +3 -5
- data/lib/ridgepole/dsl_parser/table_definition.rb +0 -2
- data/lib/ridgepole/dumper.rb +0 -2
- data/lib/ridgepole/execute_expander.rb +2 -4
- data/lib/ridgepole/ext/abstract_adapter/disable_table_options.rb +0 -2
- data/lib/ridgepole/ext/abstract_mysql_adapter/dump_auto_increment.rb +0 -2
- data/lib/ridgepole/ext/abstract_mysql_adapter/use_alter_index.rb +0 -2
- data/lib/ridgepole/ext/pp_sort_hash.rb +0 -2
- data/lib/ridgepole/ext/schema_dumper.rb +0 -2
- data/lib/ridgepole/external_sql_executer.rb +0 -2
- data/lib/ridgepole/logger.rb +0 -2
- data/lib/ridgepole/migration_ext.rb +0 -2
- data/lib/ridgepole/schema_dumper_ext.rb +0 -2
- data/lib/ridgepole/schema_statements_ext.rb +0 -2
- data/lib/ridgepole/version.rb +1 -3
- data/ridgepole.gemspec +0 -2
- data/spec/cli_helper.rb +0 -2
- data/spec/erb_helper.rb +0 -2
- data/spec/hide_pending_formatter.rb +0 -2
- data/spec/mysql/_migrate/migrate_change_table_option_spec.rb +3 -5
- data/spec/mysql/bigint_pk/bigint_pk_spec.rb +0 -2
- data/spec/mysql/bigint_pk/int_pk_spec.rb +0 -2
- data/spec/mysql/cli/config_spec.rb +0 -2
- data/spec/mysql/cli/ridgepole_spec.rb +0 -2
- data/spec/mysql/collation/collation_spec.rb +0 -2
- data/spec/mysql/comment/comment_spec.rb +0 -2
- data/spec/mysql/default_lambda/default_lambda_spec.rb +0 -2
- data/spec/mysql/diff/diff2_spec.rb +0 -2
- data/spec/mysql/diff/diff_spec.rb +0 -2
- data/spec/mysql/dump/dump_class_method_spec.rb +0 -2
- data/spec/mysql/dump/dump_some_tables_spec.rb +0 -2
- data/spec/mysql/dump/dump_spec.rb +0 -2
- data/spec/mysql/dump/dump_unknown_column_type_spec.rb +0 -2
- data/spec/mysql/dump/dump_without_table_options_spec.rb +0 -2
- data/spec/mysql/fk/migrate_change_fk2_spec.rb +0 -2
- data/spec/mysql/fk/migrate_change_fk_spec.rb +0 -2
- data/spec/mysql/fk/migrate_create_fk_spec.rb +0 -2
- data/spec/mysql/fk/migrate_drop_fk_spec.rb +0 -2
- data/spec/mysql/fk/migrate_ignore_fk_spec.rb +0 -2
- data/spec/mysql/migrate/check_orphan_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_add_column2_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_add_column_order_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_add_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_add_column_with_alter_extra_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_add_column_with_script_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column2_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column3_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column4_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column5_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column6_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column7_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column8_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column_default_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column_float_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index2_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index3_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index4_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index5_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index6_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index7_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index8_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_table_comment_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_change_table_option_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_check_relation_column_type_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_index2_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_table_with_ignore_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_table_with_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_table_with_options_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_create_table_with_script_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_column_and_index2_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_column_and_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_column_and_unique_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_drop_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_duplicate_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_duplicate_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_empty_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_execute_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_ignore_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_ignore_index_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_log_file_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_merge_mode_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_noop_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_primary_key_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_rename_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_rename_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_same_default_null_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_same_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_script_error_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_skip_column_comment_change_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_skip_drop_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_skip_rename_column_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_skip_rename_table_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_with_ignore_tables_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_with_pre_post_query_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_with_tables_spec.rb +0 -2
- data/spec/mysql/migrate/migrate_with_verbose_log_spec.rb +0 -2
- data/spec/mysql/migrate_/migrate_create_index_with_alter_spec.rb +0 -2
- data/spec/mysql/migrate_/migrate_drop_index_with_alter_spec.rb +0 -2
- data/spec/mysql/text_blob_types/text_blob_types_spec.rb +50 -10
- data/spec/mysql/~default_name_fk/migrate_change_fk_spec.rb +0 -2
- data/spec/mysql/~default_name_fk/migrate_create_fk_spec.rb +0 -2
- data/spec/mysql/~default_name_fk/migrate_drop_fk_spec.rb +0 -2
- data/spec/mysql/~dump_auto_increment/migrate_create_table_with_index_spec.rb +0 -2
- data/spec/mysql57/json/add_json_column_spec.rb +0 -2
- data/spec/mysql57/json/change_json_column_spec.rb +0 -2
- data/spec/mysql57/json/drop_json_column_spec.rb +0 -2
- data/spec/mysql57/virtual/add_virtual_column_spec.rb +0 -2
- data/spec/mysql57/virtual/change_virtual_column_spec.rb +0 -2
- data/spec/mysql57/virtual/drop_virtual_column_spec.rb +0 -2
- data/spec/postgresql/diff/diff_spec.rb +0 -2
- data/spec/postgresql/dump/dump_spec.rb +0 -2
- data/spec/postgresql/fk/migrate_change_fk_spec.rb +0 -2
- data/spec/postgresql/fk/migrate_create_fk_spec.rb +0 -2
- data/spec/postgresql/fk/migrate_drop_fk_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_add_column_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_add_expression_index_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_bigint_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_change_column_default_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_change_column_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_change_index_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_check_relation_column_type_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_create_table_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_create_table_with_default_proc_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_drop_column_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_drop_column_with_index_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_drop_expression_index_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_drop_index_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_drop_table_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_ext_cols_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_primary_key2_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_primary_key_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_references_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_rename_column_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_rename_table_spec.rb +0 -2
- data/spec/postgresql/migrate/migrate_same_spec.rb +0 -2
- data/spec/postgresql/~default_name_fk/migrate_change_fk_spec.rb +0 -2
- data/spec/postgresql/~default_name_fk/migrate_create_fk_spec.rb +0 -2
- data/spec/postgresql/~default_name_fk/migrate_drop_fk_spec.rb +0 -2
- data/spec/processing_for_travis.rb +0 -2
- data/spec/spec_condition.rb +0 -2
- data/spec/spec_const.rb +7 -9
- data/spec/spec_helper.rb +0 -2
- metadata +6 -7
- 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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 51752811fa355ec8328988d3f2b78f5eaa972379763e56498d7a9d8130e72b7c
|
4
|
+
data.tar.gz: 0e7dc4410a0c90fadc8c49d17292f947dfb14740cd89556e00420712a667ee79
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cec836a87f959d8ded39667c3e726c9c11756fa20a03e75d9082cb5e7325ecb75aa6e4faf4660ad08615d333e50f8799157228b60fed4f176480656e9b0c9d46
|
7
|
+
data.tar.gz: e1dd85e686cf7ebf3bee192e2ac26f1f533f935a9e0c286ab6717badd288572325fe6dca5fb8393d94d8c138407a5ca4718480274cd6c4d618ffe01b411ea196
|
data/.rspec
CHANGED
data/.rubocop.yml
CHANGED
@@ -2,7 +2,7 @@ AllCops:
|
|
2
2
|
Exclude:
|
3
3
|
- 'gemfiles/**/*'
|
4
4
|
- 'omnibus-ridgepole/**/*'
|
5
|
-
TargetRubyVersion: 2.
|
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.
|
10
|
-
- 2.
|
11
|
-
- 2.
|
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
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
|
+
[![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
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
|
data/lib/ridgepole.rb
CHANGED
data/lib/ridgepole/cli/config.rb
CHANGED
data/lib/ridgepole/client.rb
CHANGED
data/lib/ridgepole/delta.rb
CHANGED
data/lib/ridgepole/diff.rb
CHANGED
@@ -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]
|
352
|
+
if @options[:tables] && @options[:tables].include?(table_name)
|
355
353
|
true
|
356
|
-
elsif @options[:ignore_tables]
|
354
|
+
elsif @options[:ignore_tables] && @options[:ignore_tables].any? { |i| i =~ table_name }
|
357
355
|
false
|
358
356
|
elsif @options[:tables]
|
359
357
|
false
|
data/lib/ridgepole/dsl_parser.rb
CHANGED
@@ -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]
|
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
|
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/}
|
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)
|
data/lib/ridgepole/dumper.rb
CHANGED
@@ -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
|
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
|
31
|
+
if sql =~ /\A(SELECT|SHOW)\b/i
|
34
32
|
super(sql, name)
|
35
33
|
else
|
36
34
|
sql = append_alter_extra(sql)
|
data/lib/ridgepole/logger.rb
CHANGED
data/lib/ridgepole/version.rb
CHANGED
data/ridgepole.gemspec
CHANGED
data/spec/cli_helper.rb
CHANGED
data/spec/erb_helper.rb
CHANGED
@@ -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
|