exwiw 0.4.9 → 0.4.10

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: b096127aa5a8f1a530af7967ac092c11ab7dd57a88ddb82697386d9ac1791e3d
4
- data.tar.gz: 519ffff515c719d245bb32b9c1b0a64c6ff988502bc39a6af661962506f199be
3
+ metadata.gz: a89e3da8899badc5bcccc98f58878744b9b106b31ca38af6a70b41109002d126
4
+ data.tar.gz: 13dd0757b0699c7865cd4c89b214288d16d017a9447c042e90c3da5cedc6f4b2
5
5
  SHA512:
6
- metadata.gz: 141955fba03d98e9cddead32de182db1d4e116b2ef758723478528c552ff27eadd6f88ef96587c14c543caaebf16accaa88c62a0e0c84d65e0c3d0abee3d0574
7
- data.tar.gz: 2f284c6753f957a58bbbaa4736a3fed95e55263b6b15b3434cefa70b0de0907fb3c12ce770c58c1cf94fe757ee962d5d27e1a97cff62221a9f756c2a99c70947
6
+ metadata.gz: b04b7e070c1215b24c6dfa6453e572bf560d77fbd9a6eb6172fbd301a8b662ebc1da815f13d5fb4ba31799a5e8e45c610c0271e810eff6c8c675e75fcf261e2d
7
+ data.tar.gz: 4b88cfc7ed7a758b7a82b76d9e936c251b388825411fef9c305434919b7695f6866e5011828a6a2bf00c95692d157c1f0e4e768e0dc3e9ab79b980f025e4c626
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## [Unreleased]
4
4
 
5
+ ## [0.4.10] - 2026-06-12
6
+
7
+ ### Fixed
8
+
9
+ - PostgreSQL: schema dump now strips `CREATE TRIGGER` statements from `insert-000-schema.sql`. `pg_dump --table` includes triggers but not the standalone function definitions they reference, causing `PG::UndefinedFunction` errors on restore. Handles `CREATE CONSTRAINT TRIGGER` and `CREATE OR REPLACE TRIGGER` variants. ([#96](https://github.com/heyinc/exwiw/pull/96))
10
+
5
11
  ## [0.4.9] - 2026-06-11
6
12
 
7
13
  ### Fixed
@@ -77,6 +77,7 @@ module Exwiw
77
77
  idempotent = DdlPostprocessor.add_if_not_exists_to_create_table(idempotent)
78
78
  idempotent = DdlPostprocessor.add_if_not_exists_to_create_index(idempotent)
79
79
  idempotent = DdlPostprocessor.wrap_add_constraint_in_do_block(idempotent)
80
+ idempotent = DdlPostprocessor.strip_triggers(idempotent)
80
81
 
81
82
  File.open(output_path, 'w') do |file|
82
83
  file.puts("-- Auto-generated by exwiw via pg_dump. Idempotent DDL for postgresql.")
@@ -58,6 +58,12 @@ module Exwiw
58
58
  end
59
59
  end
60
60
 
61
+ # pg_dump --table includes triggers but not the referenced function
62
+ # definitions, causing UndefinedFunction errors on the target DB.
63
+ def strip_triggers(sql)
64
+ sql.gsub(/^[ \t]*CREATE\s+(?:OR\s+REPLACE\s+)?(?:CONSTRAINT\s+)?TRIGGER\b[^;]*;\r?\n?/i, "")
65
+ end
66
+
61
67
  # Generate idempotent CREATE TYPE ... AS ENUM statements.
62
68
  # +enum_types+ is an Array of Hashes with keys :schema, :name, :labels.
63
69
  def create_type_enum_statements(enum_types)
data/lib/exwiw/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Exwiw
4
- VERSION = "0.4.9"
4
+ VERSION = "0.4.10"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: exwiw
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.9
4
+ version: 0.4.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Shia