fast_schema_dumper 0.3.0 → 0.4.1
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 +14 -0
- data/README.md +4 -1
- data/lib/fast_schema_dumper/fast_dumper.rb +17 -1
- data/lib/fast_schema_dumper/version.rb +1 -1
- metadata +5 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: f7ed54818e10cb88e139c56e96fc8379c776e0262a3f0f36d47050107ff056fc
|
|
4
|
+
data.tar.gz: 57751356847840980ad816203b64a8555ea8f5cc10aadcffdb5bc97aa313b7af
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 4ccda99085696b3f1c1f85ee32b10f982f2bf251ea9fef597978caf1263bcfc6ce92e9e3f76d54df6b2662175e6aeb51326e8810ea675a1bb6f18be3f15a5ced
|
|
7
|
+
data.tar.gz: 20466602247c4a6ca30dbbb2f3cceef573757597596128996d51752cfcee24276c22981efecd3bfdfd6646f1821c816e7a37f894741d852e2a040f571e0445af
|
data/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
## [Unreleased]
|
|
2
|
+
|
|
3
|
+
## [0.4.0] - 2025-11-06
|
|
4
|
+
|
|
5
|
+
## [0.3.0] - 2025-10-31
|
|
6
|
+
|
|
7
|
+
- Support handling of CHECK constraints. [#1](https://github.com/smartbank-inc/fast_schema_dumper/pull/1)
|
|
8
|
+
- Always dump `orig.txt` and `fast.txt` in verify mode.
|
|
9
|
+
|
|
10
|
+
## [0.2.0] - 2025-10-03
|
|
11
|
+
|
|
12
|
+
## [0.1.0] - 2025-07-10
|
|
13
|
+
|
|
14
|
+
- Initial release
|
data/README.md
CHANGED
|
@@ -24,7 +24,6 @@ The Ridgepole integration is configurable via envionment variables.
|
|
|
24
24
|
|
|
25
25
|
I recommend using only fast_schema_dumper in local development environments, and configuring `FAST_SCHEMA_DUMPER_MODE=verify` in CI setups.
|
|
26
26
|
|
|
27
|
-
|
|
28
27
|
## Installation
|
|
29
28
|
|
|
30
29
|
Install the gem and add to the application's Gemfile by executing:
|
|
@@ -48,3 +47,7 @@ To install this gem onto your local machine, run `bundle exec rake install`. To
|
|
|
48
47
|
## Contributing
|
|
49
48
|
|
|
50
49
|
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/fast_schema_dumper.
|
|
50
|
+
|
|
51
|
+
## Releasing
|
|
52
|
+
|
|
53
|
+
Kick the GitHub Actions workflow.
|
|
@@ -338,8 +338,14 @@ module FastSchemaDumper
|
|
|
338
338
|
check_clause = constraint[:check_clause]
|
|
339
339
|
|
|
340
340
|
# drop redundant parentheses at the most outer level for compatibility with the original dumper
|
|
341
|
+
# Example: "((a > 0) and (b > 0))" => "(a > 0) and (b > 0)"
|
|
341
342
|
if check_clause.start_with?("(") && check_clause.end_with?(")")
|
|
342
|
-
|
|
343
|
+
# Check if removing outer parens would break the expression by ensuring parentheses are balanced after removal
|
|
344
|
+
# For example, it shouldn’t remove the outer parentheses as in the following case, because doing so would break the balance: "(a > 0) and (b > 0)"
|
|
345
|
+
inner = check_clause[1..-2]
|
|
346
|
+
if balanced_parentheses?(inner)
|
|
347
|
+
check_clause = inner
|
|
348
|
+
end
|
|
343
349
|
end
|
|
344
350
|
|
|
345
351
|
check_clause.gsub!(/\\'/, "'") # don't escape single quotes for compatibility with the original dumper
|
|
@@ -525,5 +531,15 @@ module FastSchemaDumper
|
|
|
525
531
|
|
|
526
532
|
idx_def
|
|
527
533
|
end
|
|
534
|
+
|
|
535
|
+
def balanced_parentheses?(str)
|
|
536
|
+
depth = 0
|
|
537
|
+
str.each_char do |char|
|
|
538
|
+
depth += 1 if char == '('
|
|
539
|
+
depth -= 1 if char == ')'
|
|
540
|
+
return false if depth < 0
|
|
541
|
+
end
|
|
542
|
+
depth == 0
|
|
543
|
+
end
|
|
528
544
|
end
|
|
529
545
|
end
|
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: fast_schema_dumper
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.4.1
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Daisuke Aritomo
|
|
@@ -25,11 +25,14 @@ dependencies:
|
|
|
25
25
|
version: '0'
|
|
26
26
|
email:
|
|
27
27
|
- osyoyu@osyoyu.com
|
|
28
|
+
- over.rye@gmail.com
|
|
29
|
+
- moznion@mail.moznion.net
|
|
28
30
|
executables:
|
|
29
31
|
- fast_schema_dumper
|
|
30
32
|
extensions: []
|
|
31
33
|
extra_rdoc_files: []
|
|
32
34
|
files:
|
|
35
|
+
- CHANGELOG.md
|
|
33
36
|
- README.md
|
|
34
37
|
- Rakefile
|
|
35
38
|
- exe/fast_schema_dumper
|
|
@@ -58,7 +61,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
58
61
|
- !ruby/object:Gem::Version
|
|
59
62
|
version: '0'
|
|
60
63
|
requirements: []
|
|
61
|
-
rubygems_version: 3.
|
|
64
|
+
rubygems_version: 3.6.9
|
|
62
65
|
specification_version: 4
|
|
63
66
|
summary: A fast alternative to ActiveRecord::SchemaDumper
|
|
64
67
|
test_files: []
|