ridgepole 0.8.9 → 0.8.10

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
  SHA256:
3
- metadata.gz: b4a820687bccfcbcfaa3290b28536a0ea3599d32a35a16e897f37a20a4e1ef75
4
- data.tar.gz: c25c8a48b003aa297f7b1a979f609898b776c3393628d42c2dc2a0897d87be0e
3
+ metadata.gz: 6f850327d50c5d732987209c8c8eb5c9db3090e1b638f2ee9dbc8ced0959b128
4
+ data.tar.gz: 242e925ebc5c1a94d0c68e605e894a55efab238f1184b67d1a6a56f4aee51078
5
5
  SHA512:
6
- metadata.gz: d58fae0cd35607eb2980be9600b0d31b04605c559445932d7f73ab7cec066267bb45da5ef783c0ab577fec2272f664214afd190d088c1976f299fcfb30a6c54a
7
- data.tar.gz: 498c6a55c4d7480a7ac019e58ddc63a8212961bda3d587f9d30d860be1d04d8a8f33e5bcbac72044d759919a3abba46f36750cc4cf2bcd44b87d4af352f7318d
6
+ metadata.gz: 0451a8c71155ff9fd991045e04973cdf063c405dc1013c63883db20ce11bad93ce4f7cdd0533d5ae12f4a9c35bbf03e18e04a6487ad217baf614a090837095d4
7
+ data.tar.gz: f4bb253e35a0f7904a0b17effd29a5e388449d4a295282f9f1652f1dd11f6d8a9c1df8dbd176efcf884cda5e15e15bf80db61b69bfd7f702ee43de2e0b70a186
@@ -0,0 +1,62 @@
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.0.gemfile
24
+ - gemfiles/activerecord_5.1.gemfile
25
+ - gemfiles/activerecord_5.2.gemfile
26
+ - gemfiles/activerecord_6.0.gemfile
27
+ exclude:
28
+ - ruby: 2.4
29
+ gemfile: gemfiles/activerecord_6.0.gemfile
30
+
31
+ steps:
32
+ - uses: actions/checkout@v2
33
+ - uses: actions/setup-ruby@v1
34
+ with:
35
+ ruby-version: ${{ matrix.ruby }}
36
+ - uses: actions/cache@v2
37
+ with:
38
+ path: gemfiles/vendor/bundle
39
+ key: ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-${{ hashFiles('ridgepole.gemspec', '**/Gemfile', '${{ matrix.gemfile }}') }}
40
+ restore-keys: |
41
+ ${{ runner.os }}-gems-${{ matrix.ruby }}-${{ matrix.gemfile }}-
42
+
43
+ - name: Setup dependencies
44
+ run: |
45
+ for i in {1..60}; do docker-compose up -d && break; sleep 1; done
46
+
47
+ bundle config path vendor/bundle
48
+ bundle install --jobs 4 --retry 3
49
+
50
+ # Wait until database servers start
51
+ function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 -ppassword ping; }
52
+ function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 -ppassword ping; }
53
+ function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; }
54
+ for i in {1..60}; do mysql_ping && break; sleep 1; done
55
+ for i in {1..60}; do mysql57_ping && break; sleep 1; done
56
+ for i in {1..60}; do pg_ping && break; sleep 1; done
57
+ env:
58
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
59
+
60
+ - run: ${{ matrix.env }} bundle exec rake
61
+ env:
62
+ BUNDLE_GEMFILE: ${{ matrix.gemfile }}
data/README.md CHANGED
@@ -6,7 +6,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
6
6
  (like Chef/Puppet)
7
7
 
8
8
  [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](http://badge.fury.io/rb/ridgepole)
9
- [![Build Status](https://travis-ci.org/winebarrel/ridgepole.svg?branch=0.8)](https://travis-ci.org/winebarrel/ridgepole)
9
+ [![Build Status](https://github.com/winebarrel/ridgepole/workflows/test/badge.svg?branch=0.8)](https://github.com/winebarrel/ridgepole/actions)
10
10
  [![Coverage Status](https://coveralls.io/repos/github/winebarrel/ridgepole/badge.svg?branch=0.8)](https://coveralls.io/github/winebarrel/ridgepole?branch=0.8)
11
11
 
12
12
  <details><summary>ChangeLog</summary>
@@ -120,6 +120,8 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
120
120
  * `>= 0.8.9`
121
121
  * Fix unexpected differences on text types and blob types on Rails 6 ([pull#306](https://github.com/winebarrel/ridgepole/pull/306))
122
122
  * Fix unexpected warning when a foreign key is added on the primary key ([pull#307](https://github.com/winebarrel/ridgepole/pull/307))
123
+ * `>= 0.8.10`
124
+ * Raise an error if an InnoDB column has a foreign key but no index ([pull#310](https://github.com/winebarrel/ridgepole/pull/310))
123
125
  </details>
124
126
 
125
127
  ## Installation
@@ -39,10 +39,7 @@ module Ridgepole
39
39
  next if attrs[:indices]&.any? { |_k, v| v[:column_name].first == fk_index }
40
40
  next if attrs[:options][:primary_key] == fk_index
41
41
 
42
- Ridgepole::Logger.instance.warn(<<-MSG)
43
- [WARNING] Table `#{table_name}` has a foreign key on `#{fk_index}` column, but doesn't have any indexes on the column.
44
- Although an index will be added automatically by InnoDB, please add an index explicitly before the next operation.
45
- MSG
42
+ raise "The column `#{fk_index}` of the table `#{table_name}` has a foreign key but no index. Although InnoDB creates an index automatically, please add one explicitly in order for ridgepole to manage it."
46
43
  end
47
44
  end
48
45
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '0.8.9'
4
+ VERSION = '0.8.10'
5
5
  end
@@ -186,13 +186,9 @@ describe 'Ridgepole::Client#diff -> migrate' do
186
186
  subject { client(dump_without_table_options: false) }
187
187
 
188
188
  it {
189
- expect(Ridgepole::Logger.instance).to receive(:warn).with(<<-MSG).twice
190
- [WARNING] Table `child` has a foreign key on `parent_id` column, but doesn't have any indexes on the column.
191
- Although an index will be added automatically by InnoDB, please add an index explicitly before the next operation.
192
- MSG
193
- subject.diff(dsl).migrate
194
-
195
- expect(subject.diff(dsl).differ?).to be_truthy
189
+ expect do
190
+ subject.diff(dsl).migrate
191
+ end.to raise_error('The column `parent_id` of the table `child` has a foreign key but no index. Although InnoDB creates an index automatically, please add one explicitly in order for ridgepole to manage it.')
196
192
  }
197
193
  end
198
194
 
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.8.9
4
+ version: 0.8.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-08-09 00:00:00.000000000 Z
11
+ date: 2020-08-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -235,10 +235,10 @@ executables:
235
235
  extensions: []
236
236
  extra_rdoc_files: []
237
237
  files:
238
+ - ".github/workflows/test.yml"
238
239
  - ".gitignore"
239
240
  - ".rspec"
240
241
  - ".rubocop.yml"
241
- - ".travis.yml"
242
242
  - Appraisals
243
243
  - Gemfile
244
244
  - LICENSE.txt
@@ -1,45 +0,0 @@
1
- dist: trusty
2
- sudo: required
3
- group: edge
4
- language: ruby
5
- cache:
6
- - bundler
7
- rvm:
8
- - 2.4.9
9
- - 2.5.7
10
- - 2.6.5
11
- - 2.7.1
12
- before_script:
13
- - sudo service mysql stop
14
- - sudo service postgresql stop
15
- - for i in {1..60}; do docker-compose up -d && break; sleep 1; done
16
- - function mysql_ping { mysqladmin -u root -h 127.0.0.1 -P 13316 -ppassword ping; }
17
- - function mysql57_ping { mysqladmin -u root -h 127.0.0.1 -P 13317 -ppassword ping; }
18
- - function pg_ping { PGPASSWORD=password pg_isready -U postgres -h 127.0.0.1 -p 15442; }
19
- - for i in {1..60}; do mysql_ping && break; sleep 1; done
20
- - for i in {1..60}; do mysql57_ping && break; sleep 1; done
21
- - for i in {1..60}; do pg_ping && break; sleep 1; done
22
- script:
23
- - bundle exec rake
24
- gemfile:
25
- - gemfiles/activerecord_5.0.gemfile
26
- - gemfiles/activerecord_5.1.gemfile
27
- - gemfiles/activerecord_5.2.gemfile
28
- - gemfiles/activerecord_6.0.gemfile
29
- env:
30
- matrix:
31
- - MYSQL56=1
32
- - MYSQL57=1
33
- - POSTGRESQL=1
34
- services:
35
- - docker
36
- addons:
37
- apt:
38
- packages:
39
- - mysql-client-core-5.6
40
- - mysql-client-5.6
41
- - postgresql-client-9.4
42
- matrix:
43
- exclude:
44
- - rvm: 2.4.9
45
- gemfile: gemfiles/activerecord_6.0.gemfile