ridgepole 3.2.5 → 3.2.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: abd4de93bb4a0d0938356df4090e8f4c703f0e8cb17e4b4c886174aed0fc757c
4
- data.tar.gz: d0e95a3692a07834a515a833500918c01fca28dcdf38bda90dc9a4974f1efccf
3
+ metadata.gz: 8b16d734d37afb3ba4d9633e3dc9c414145c62787c9e1f58bd1ac15d7104ce7a
4
+ data.tar.gz: c5a4f8959cb6196d6d70974738ee809b0d3d32a8f86ea142296479c46868a77b
5
5
  SHA512:
6
- metadata.gz: ef67a2f85f7d9d510384409483a52c9ea7620d8bc85219d14ab26818759e85d603f6aa22c1c8a3a3e40cf1f7f15f9093810bb03c5c1737091d5afe770c7d62a4
7
- data.tar.gz: 7a6320a5a28a23a8fbeed7448b1715c845e7985d8d45a3f7ef9ed7d17c4246b20a2e407790daebbf0795e10462c2e121ad74ce472015c7a9810c30aa19194e11
6
+ metadata.gz: 3559c20316244fbb389631d2ec6cd3b5b4e3acbaeb4c98394f8246771807ee339222eaf959c21ec1af84bf8af8ed8dd5ca1d856910074d1803de1e99055bd3a8
7
+ data.tar.gz: 0d1ca661c53aa4f746ef1a566eeb88081109e865d2ec2a6acf3ed250c3dc71971f8a7fa620e0cfd0cd76d0f0ca4107d4768da9e96911a55542b718750038c3e7
data/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  ## 3.2
4
4
 
5
+ ### 3.2.6 (2026/10/15)
6
+
7
+ - Pass `column:` to `remove_foreign_key` for unnamed foreign keys. [pull#746](https://github.com/ridgepole/ridgepole/pull/746)
8
+ - Support the batched `table_options` API in Rails 8.2. [pull#740](https://github.com/ridgepole/ridgepole/pull/740)
9
+
5
10
  ### 3.2.5 (2026/08/11)
6
11
 
7
12
  - Fix `--with-apply` validation to require `--config`. [pull#733](https://github.com/ridgepole/ridgepole/pull/733)
data/README.md CHANGED
@@ -8,6 +8,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
8
8
  [![Gem Version](https://badge.fury.io/rb/ridgepole.svg)](https://badge.fury.io/rb/ridgepole)
9
9
  [![test](https://github.com/ridgepole/ridgepole/actions/workflows/test.yml/badge.svg)](https://github.com/ridgepole/ridgepole/actions/workflows/test.yml)
10
10
  [![codecov](https://codecov.io/gh/ridgepole/ridgepole/graph/badge.svg)](https://codecov.io/gh/ridgepole/ridgepole)
11
+ [![Greptile: The War on Bugs](https://www.greptile.com/badge.svg)](https://www.greptile.com/?utm_source=oss_badge&utm_medium=readme&utm_campaign=greptile_for_open_source)
11
12
 
12
13
  > [!TIP]
13
14
  > Also developing similar declarative schema tools — single Go binary, plain SQL as the schema definition. Give it a try.
@@ -586,9 +586,12 @@ add_foreign_key(#{table_name.inspect}, #{to_table.inspect}, **#{attrs_options.in
586
586
  def append_remove_foreign_key(table_name, attrs, buf, _options)
587
587
  attrs_options = attrs[:options] || {}
588
588
  fk_name = attrs_options[:name]
589
+ fk_column = attrs_options[:column]
589
590
 
590
591
  target = if fk_name
591
592
  "name: #{fk_name.inspect}"
593
+ elsif fk_column
594
+ "#{attrs.fetch(:to_table).inspect}, column: #{fk_column.inspect}"
592
595
  else
593
596
  attrs.fetch(:to_table).inspect
594
597
  end
@@ -16,14 +16,28 @@ module Ridgepole
16
16
  def table_options(table_name)
17
17
  options = super
18
18
 
19
- if options && @__without_table_options
20
- options.delete(:options)
21
- options.delete(:charset)
22
- options.delete(:collation)
19
+ if @__without_table_options
20
+ # NOTE: Since Rails 8.2, `table_options` also accepts an array of table names
21
+ # and then returns a hash of options keyed by table name.
22
+ if table_name.is_a?(Array)
23
+ options.each_value { |table_option| delete_table_options!(table_option) }
24
+ else
25
+ delete_table_options!(options)
26
+ end
23
27
  end
24
28
 
25
29
  options
26
30
  end
31
+
32
+ private
33
+
34
+ def delete_table_options!(options)
35
+ return unless options
36
+
37
+ options.delete(:options)
38
+ options.delete(:charset)
39
+ options.delete(:collation)
40
+ end
27
41
  end
28
42
  end
29
43
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Ridgepole
4
- VERSION = '3.2.5'
4
+ VERSION = '3.2.6'
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ridgepole
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.2.5
4
+ version: 3.2.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Genki Sugawara
@@ -245,14 +245,14 @@ dependencies:
245
245
  requirements:
246
246
  - - '='
247
247
  - !ruby/object:Gem::Version
248
- version: 1.89.0
248
+ version: 1.91.0
249
249
  type: :development
250
250
  prerelease: false
251
251
  version_requirements: !ruby/object:Gem::Requirement
252
252
  requirements:
253
253
  - - '='
254
254
  - !ruby/object:Gem::Version
255
- version: 1.89.0
255
+ version: 1.91.0
256
256
  - !ruby/object:Gem::Dependency
257
257
  name: rubocop-rake
258
258
  requirement: !ruby/object:Gem::Requirement