ridgepole 3.2.4 → 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 +4 -4
- data/CHANGELOG.md +9 -0
- data/README.md +1 -0
- data/bin/ridgepole +1 -1
- data/lib/ridgepole/delta.rb +3 -0
- data/lib/ridgepole/ext/abstract_adapter/disable_table_options.rb +18 -4
- data/lib/ridgepole/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 8b16d734d37afb3ba4d9633e3dc9c414145c62787c9e1f58bd1ac15d7104ce7a
|
|
4
|
+
data.tar.gz: c5a4f8959cb6196d6d70974738ee809b0d3d32a8f86ea142296479c46868a77b
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3559c20316244fbb389631d2ec6cd3b5b4e3acbaeb4c98394f8246771807ee339222eaf959c21ec1af84bf8af8ed8dd5ca1d856910074d1803de1e99055bd3a8
|
|
7
|
+
data.tar.gz: 0d1ca661c53aa4f746ef1a566eeb88081109e865d2ec2a6acf3ed250c3dc71971f8a7fa620e0cfd0cd76d0f0ca4107d4768da9e96911a55542b718750038c3e7
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,15 @@
|
|
|
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
|
+
|
|
10
|
+
### 3.2.5 (2026/08/11)
|
|
11
|
+
|
|
12
|
+
- Fix `--with-apply` validation to require `--config`. [pull#733](https://github.com/ridgepole/ridgepole/pull/733)
|
|
13
|
+
|
|
5
14
|
### 3.2.4 (2026/08/08)
|
|
6
15
|
|
|
7
16
|
- Fix inverted "No change" log in `--diff --with-apply`. [pull#730](https://github.com/ridgepole/ridgepole/pull/730)
|
data/README.md
CHANGED
|
@@ -8,6 +8,7 @@ It defines DB schema using [Rails DSL](http://guides.rubyonrails.org/migrations.
|
|
|
8
8
|
[](https://badge.fury.io/rb/ridgepole)
|
|
9
9
|
[](https://github.com/ridgepole/ridgepole/actions/workflows/test.yml)
|
|
10
10
|
[](https://codecov.io/gh/ridgepole/ridgepole)
|
|
11
|
+
[](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.
|
data/bin/ridgepole
CHANGED
|
@@ -168,7 +168,7 @@ ARGV.options do |opt|
|
|
|
168
168
|
|
|
169
169
|
opt.parse!
|
|
170
170
|
|
|
171
|
-
if !mode || (%i[apply export].include?(mode) && !config) || (
|
|
171
|
+
if !mode || (%i[apply export].include?(mode) && !config) || (diff_with_apply && !config)
|
|
172
172
|
puts opt.help
|
|
173
173
|
exit 1
|
|
174
174
|
end
|
data/lib/ridgepole/delta.rb
CHANGED
|
@@ -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
|
|
20
|
-
|
|
21
|
-
options.
|
|
22
|
-
|
|
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
|
data/lib/ridgepole/version.rb
CHANGED
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.
|
|
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.
|
|
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.
|
|
255
|
+
version: 1.91.0
|
|
256
256
|
- !ruby/object:Gem::Dependency
|
|
257
257
|
name: rubocop-rake
|
|
258
258
|
requirement: !ruby/object:Gem::Requirement
|