activerecord-pg-format-db-structure 0.3.0 → 0.4.0

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: a18ecc82be3d91f7163c58a3e585c2fa4792767cf07467d3bee7e741fac2281b
4
- data.tar.gz: 33def417b36f7f11eba8fce6d57f270aaf29b1320e6cf75b3a183719493bb2b5
3
+ metadata.gz: 74eff8ba4546f71002cc784146845e66b74a38cfdfe6f2604b6ee34994269564
4
+ data.tar.gz: 330f056b6883d6dbbfc253ac9230794756f0a45b19527ecdb8af3005b01dc55e
5
5
  SHA512:
6
- metadata.gz: a9a16f498480f55da503970918cf3a6df4e1899dd0c9331faa684b12ddbb32f1bde3935d7becae37f3e7f9e15190e0939f9587348c5786031c1c1edbf7cd7cfb
7
- data.tar.gz: a1cead05ba2829d0fee3364e097495f7c100cc84cee09bfe2ae08e8b8a23d99ec5a16500af9d0611f5bf4f9db2b3fcc70ed492e1acc508aa2aa038e5db55de8e
6
+ metadata.gz: 64f5bcc1ca4e2b6033b83acc918372e20c19765315f7c03bfb8666190d255a7e9c8bb4fde73c28ce2c2af109423bc739af0938e638c003bb6dabdcb277a12861
7
+ data.tar.gz: 30fb3d9e684ac251b20f6eee82a791c075173cf2385f8e8c69b14e726ceda554cc6ab768f8bca0fea6f4fedc1b08d7b34a71c64d0002fbff95b8d32f8951ae06
data/.rubocop.yml CHANGED
@@ -1,4 +1,4 @@
1
- require:
1
+ plugins:
2
2
  - rubocop-rake
3
3
  - rubocop-rspec
4
4
 
@@ -119,6 +119,8 @@ Lint/UnexpectedBlockArity: # new in 1.5
119
119
  Enabled: true
120
120
  Lint/UnmodifiedReduceAccumulator: # new in 1.1
121
121
  Enabled: true
122
+ Lint/UselessConstantScoping:
123
+ Enabled: false
122
124
  Lint/UselessDefined: # new in 1.69
123
125
  Enabled: true
124
126
  Lint/UselessNumericOperation: # new in 1.66
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  ## [Unreleased]
2
2
 
3
+ ## [0.4.0] - 2025-03-21
4
+
5
+ - Remove no-op `NOT VALID` setting when inlining constraints
6
+
3
7
  ## [0.3.0] - 2025-03-15
4
8
 
5
9
  - Introduce StatementAppender for better spacing between statements
data/README.md CHANGED
@@ -347,7 +347,9 @@ sequence indeed has default settings.
347
347
 
348
348
  ### InlineConstraints
349
349
 
350
- Inline non-foreign key constraints into table declaration
350
+ Inline non-foreign key constraints into table declaration.
351
+
352
+ Note that this also remove the `NOT VALID` setting if present, since that's a no-op when the constraint is created at the same time as the table.
351
353
 
352
354
  ### MoveIndicesAfterCreateTable
353
355
 
@@ -64,7 +64,7 @@ module ActiveRecordPgFormatDbStructure
64
64
 
65
65
  def add_constraint!(raw_statement, constraint)
66
66
  raw_statement.stmt.create_stmt.table_elts << PgQuery::Node.from(
67
- PgQuery::Constraint.new(constraint)
67
+ PgQuery::Constraint.new(constraint.merge(skip_validation: nil))
68
68
  )
69
69
  end
70
70
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveRecordPgFormatDbStructure
4
- VERSION = "0.3.0"
4
+ VERSION = "0.4.0"
5
5
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-pg-format-db-structure
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jell
8
8
  bindir: exe
9
9
  cert_chain: []
10
- date: 2025-03-15 00:00:00.000000000 Z
10
+ date: 2025-03-21 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: pg_query