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 +4 -4
- data/CHANGELOG.md +6 -0
- data/lib/exwiw/adapter/postgresql_adapter.rb +1 -0
- data/lib/exwiw/ddl_postprocessor.rb +6 -0
- data/lib/exwiw/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: a89e3da8899badc5bcccc98f58878744b9b106b31ca38af6a70b41109002d126
|
|
4
|
+
data.tar.gz: 13dd0757b0699c7865cd4c89b214288d16d017a9447c042e90c3da5cedc6f4b2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
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