ridgepole 0.7.2.beta → 0.7.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7319dc643a56f2417a20536a52d64d6b83abb83b
4
- data.tar.gz: '088ee747f3c078b55b1c9ce32bc0ace3969502c5'
3
+ metadata.gz: 40108f2b75644df8ce23f3d8a1aa0ee2107aa25c
4
+ data.tar.gz: fa253124674f5d34a96b0db3ba0e7594cbf42fdb
5
5
  SHA512:
6
- metadata.gz: 60e566a779bd9e5beb702b950ad738946c7b3df77b0d0249ee1dfd0b11b395f25b44470dde0f40848cb9dbc4715b2e09da3abe160ea88ffbc7c9f3f6924dfc10
7
- data.tar.gz: 56bddabd3f673ab2e803891fe298732b33c28b23e529104647e9f43e56e57fc2c0ed36e2d487fb49ca723da3d79fb5fe8d76890a24c0876345330770173bde9e
6
+ metadata.gz: 5a12b6e017baf87cca9aae8b817c503efa4dfffbcffc7b2ffc5ab9e96278bbbebe0d7f06d8af034da55a2dd20fae70d35a8d4ba4b70f327ae95f9690f564aff3
7
+ data.tar.gz: ac5e4ef666a799b883f87238a4b35cd48d47b8e04d67152205c3ce19392f425d98126de95274ee660cb474097421f85fcfe29f0df05c7b5c40f0e15448f1ba21
@@ -9,7 +9,9 @@ rvm:
9
9
  - 2.2.9
10
10
  - 2.3.6
11
11
  - 2.4.3
12
+ - 2.5.0
12
13
  before_install:
14
+ - gem update --system
13
15
  - gem install bundler
14
16
  before_script:
15
17
  - sudo service mysql stop
data/Appraisals CHANGED
@@ -1,5 +1,6 @@
1
1
  appraise 'activerecord-5.0' do
2
2
  gem 'activerecord', '~> 5.0.1'
3
+ gem "pg", "< 1.0.0"
3
4
  end
4
5
 
5
6
  appraise 'activerecord-5.1' do
@@ -8,8 +9,5 @@ end
8
9
 
9
10
  appraise 'activerecord-5.2' do
10
11
  gem 'mysql2', '~> 0.4.4'
11
-
12
- git 'https://github.com/rails/rails.git' do
13
- gem 'activerecord', '>= 5.2.0.beta2', '< 6'
14
- end
12
+ gem 'activerecord', '~> 5.2.0'
15
13
  end
data/README.md CHANGED
@@ -5,10 +5,6 @@ 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
- [![Prev Version](https://img.shields.io/badge/prev_version-0.6.6-brightgreen.svg)](https://rubygems.org/gems/ridgepole/versions/0.7.0.rc1)
9
- [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.6)](https://travis-ci.org/winebarrel/ridgepole)
10
- [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.6)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.6)
11
-
12
8
  [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)
13
9
  [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.7)](https://travis-ci.org/winebarrel/ridgepole)
14
10
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.7)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.7)
@@ -277,7 +273,11 @@ add_index "books", ["author_id"], name: "idx_author_id", using: :btree
277
273
 
278
274
  execute("ALTER TABLE books ADD CONSTRAINT fk_author FOREIGN KEY (author_id) REFERENCES authors (id)") do |c|
279
275
  # Execute SQL only if there is no foreign key
280
- c.raw_connection.query("SELECT 1 FROM information_schema.key_column_usage WHERE TABLE_SCHEMA = 'bookshelf' AND CONSTRAINT_NAME = 'fk_author' LIMIT 1").each.length.zero?
276
+ c.raw_connection.query(<<-SQL).each.length.zero?
277
+ SELECT 1 FROM information_schema.key_column_usage
278
+ WHERE TABLE_SCHEMA = 'bookshelf'
279
+ AND CONSTRAINT_NAME = 'fk_author' LIMIT 1
280
+ SQL
281
281
  end
282
282
  ```
283
283
 
@@ -3,5 +3,6 @@
3
3
  source "https://rubygems.org"
4
4
 
5
5
  gem "activerecord", "~> 5.0.1"
6
+ gem "pg", "< 1.0.0"
6
7
 
7
8
  gemspec path: "../"
@@ -2,10 +2,7 @@
2
2
 
3
3
  source "https://rubygems.org"
4
4
 
5
- git "https://github.com/rails/rails.git" do
6
- gem "activerecord", ">= 5.2.0.beta2", "< 6"
7
- end
8
-
9
5
  gem "mysql2", "~> 0.4.4"
6
+ gem "activerecord", "~> 5.2.0"
10
7
 
11
8
  gemspec path: "../"
@@ -139,9 +139,9 @@ class Ridgepole::Diff
139
139
  to: #{to.slice(*PRIMARY_KEY_OPTIONS)}
140
140
  EOS
141
141
  end
142
- from = from.except(*PRIMARY_KEY_OPTIONS)
143
- to = to.except(*PRIMARY_KEY_OPTIONS)
144
142
  end
143
+ from = from.except(*PRIMARY_KEY_OPTIONS)
144
+ to = to.except(*PRIMARY_KEY_OPTIONS)
145
145
 
146
146
  unless from == to
147
147
  @logger.warn(<<-EOS)
@@ -1,3 +1,3 @@
1
1
  module Ridgepole
2
- VERSION = '0.7.2.beta'
2
+ VERSION = '0.7.2'
3
3
  end
@@ -11,28 +11,48 @@ describe 'Ridgepole::Client#diff -> migrate' do
11
11
 
12
12
  context 'when allow_pk_change option is false' do
13
13
  let(:allow_pk_change) { false }
14
- let(:expected_dsl) {
15
- erbh(<<-EOS)
16
- create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
17
- end
18
- EOS
19
- }
20
14
 
21
- it {
22
- expect(Ridgepole::Logger.instance).to receive(:warn).with(<<-EOS)
15
+ context 'with difference' do
16
+ let(:expected_dsl) {
17
+ erbh(<<-EOS)
18
+ create_table "employees", id: :bigint, unsigned: true, force: :cascade do |t|
19
+ end
20
+ EOS
21
+ }
22
+
23
+ it {
24
+ expect(Ridgepole::Logger.instance).to receive(:warn).with(<<-EOS)
23
25
  [WARNING] Primary key definition of `employees` differ but `allow_pk_change` option is false
24
26
  from: {:id=>:integer, :unsigned=>true}
25
27
  to: {:id=>:bigint, :unsigned=>true}
26
- EOS
28
+ EOS
27
29
 
28
- delta = subject.diff(expected_dsl)
29
- expect(delta.differ?).to be_falsey
30
- delta.migrate
31
- expect(subject.dump).to match_ruby actual_dsl
32
- }
30
+ delta = subject.diff(expected_dsl)
31
+ expect(delta.differ?).to be_falsey
32
+ delta.migrate
33
+ expect(subject.dump).to match_ruby actual_dsl
34
+ }
35
+ end
36
+
37
+ context 'with no difference' do
38
+ let(:actual_dsl) {
39
+ erbh(<<-EOS)
40
+ create_table "employees", unsigned: true, force: :cascade do |t|
41
+ end
42
+ EOS
43
+ }
44
+ let(:expected_dsl) { actual_dsl }
45
+
46
+ it {
47
+ expect(Ridgepole::Logger.instance).to_not receive(:warn)
48
+
49
+ delta = subject.diff(expected_dsl)
50
+ expect(delta.differ?).to be_falsey
51
+ }
52
+ end
33
53
  end
34
54
 
35
- context 'when allow_pk_change option is false' do
55
+ context 'when allow_pk_change option is true' do
36
56
  let(:allow_pk_change) { true }
37
57
  let(:expected_dsl) {
38
58
  erbh(<<-EOS)
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.7.2.beta
4
+ version: 0.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-12-23 00:00:00.000000000 Z
11
+ date: 2018-05-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -402,9 +402,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
402
402
  version: 2.2.7
403
403
  required_rubygems_version: !ruby/object:Gem::Requirement
404
404
  requirements:
405
- - - ">"
405
+ - - ">="
406
406
  - !ruby/object:Gem::Version
407
- version: 1.3.1
407
+ version: '0'
408
408
  requirements: []
409
409
  rubyforge_project:
410
410
  rubygems_version: 2.6.13