schema-evolution-manager 0.9.54 → 0.9.55
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/README.md +1 -1
- data/bin/sem-apply +2 -2
- data/lib/schema-evolution-manager/db.rb +35 -2
- data/lib/schema-evolution-manager/library.rb +2 -2
- data/lib/schema-evolution-manager/script_error.rb +1 -1
- metadata +7 -10
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 13f084ac4b6a9429196469f2b1f52d04167aa443edbe7a65c68a160aab7fc041
|
4
|
+
data.tar.gz: 3676fe675b11d5b718b655ac806f66a2986c9745cd63ea52938a030af4a88d22
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a94a3a279cc858c04637c3e0cb5c9b120699e7fac2091cce7d915bda06761b4eece3fa39c2d76b4d55ec65306ae72977ca204894f130b3a633eb8e331a87c3f5
|
7
|
+
data.tar.gz: e7b3d5196adef32e19ed60f58bdcdeed6f377193ddc15f30e44f3a1018325b0ddbf2e4415269645965f24ee4cefa099e36c64cbf77722d5bacfdaed657b565b8
|
data/README.md
CHANGED
@@ -133,7 +133,7 @@ There are three ways to install schema evolution manager:
|
|
133
133
|
|
134
134
|
git clone git@github.com:mbryzek/schema-evolution-manager.git
|
135
135
|
cd schema-evolution-manager
|
136
|
-
git checkout 0.9.
|
136
|
+
git checkout 0.9.55
|
137
137
|
ruby ./configure.rb
|
138
138
|
sudo ./install.rb
|
139
139
|
|
data/bin/sem-apply
CHANGED
@@ -28,8 +28,8 @@ util = SchemaEvolutionManager::ApplyUtil.new(db, :dry_run => args.dry_run || fal
|
|
28
28
|
|
29
29
|
begin
|
30
30
|
db.bootstrap!
|
31
|
-
|
32
|
-
puts "Upgrading schema for #{db.
|
31
|
+
|
32
|
+
puts "Upgrading schema for #{db.sanitized_url}"
|
33
33
|
count = util.apply!("./scripts")
|
34
34
|
if count == 0
|
35
35
|
puts " All scripts have been previously applied"
|
@@ -34,8 +34,10 @@ module SchemaEvolutionManager
|
|
34
34
|
# executes a simple sql command.
|
35
35
|
def psql_command(sql_command)
|
36
36
|
Preconditions.assert_class(sql_command, String)
|
37
|
-
|
38
|
-
|
37
|
+
template = "#{@psql_executable_with_options} --no-align --tuples-only --no-psqlrc --command \"%s\" %s"
|
38
|
+
command = template % [sql_command, @url]
|
39
|
+
command_to_log = template % [sql_command, sanitized_url]
|
40
|
+
Library.system_or_error(command, command_to_log)
|
39
41
|
end
|
40
42
|
|
41
43
|
def Db.attribute_values(path)
|
@@ -132,6 +134,37 @@ module SchemaEvolutionManager
|
|
132
134
|
file.path
|
133
135
|
end
|
134
136
|
|
137
|
+
# Returns a sanitized version of the URL with the password removed
|
138
|
+
# to prevent passwords from being logged or displayed in error messages
|
139
|
+
def sanitized_url
|
140
|
+
# Parse the URL to extract components
|
141
|
+
if @url.include?("://")
|
142
|
+
protocol, rest = @url.split("://", 2)
|
143
|
+
lead, name = rest.split("/", 2)
|
144
|
+
|
145
|
+
# Check if there's a username:password@ pattern
|
146
|
+
if lead.include?("@")
|
147
|
+
# Take the last element as host_part to handle passwords with @ symbols
|
148
|
+
host_part = lead.split("@").last
|
149
|
+
# Take everything before the last @ as user_part
|
150
|
+
user_part = lead.split("@")[0..-2].join("@")
|
151
|
+
|
152
|
+
if user_part.include?(":")
|
153
|
+
# Remove password, keep only username (everything before the first colon)
|
154
|
+
username = user_part.split(":", 2)[0]
|
155
|
+
sanitized_lead = "#{username}:[REDACTED]@#{host_part}"
|
156
|
+
else
|
157
|
+
sanitized_lead = lead
|
158
|
+
end
|
159
|
+
"#{protocol}://#{sanitized_lead}/#{name}"
|
160
|
+
else
|
161
|
+
@url
|
162
|
+
end
|
163
|
+
else
|
164
|
+
@url
|
165
|
+
end
|
166
|
+
end
|
167
|
+
|
135
168
|
end
|
136
169
|
|
137
170
|
end
|
@@ -121,9 +121,9 @@ module SchemaEvolutionManager
|
|
121
121
|
# Runs the specified command, raising an error if there is a problem
|
122
122
|
# (based on status code of the process executed). Otherwise returns
|
123
123
|
# all the output from the script invoked.
|
124
|
-
def Library.system_or_error(command)
|
124
|
+
def Library.system_or_error(command, cmd_to_log=nil)
|
125
125
|
if Library.is_verbose?
|
126
|
-
puts command
|
126
|
+
puts cmd_to_log || command
|
127
127
|
end
|
128
128
|
|
129
129
|
begin
|
@@ -13,7 +13,7 @@ module SchemaEvolutionManager
|
|
13
13
|
|
14
14
|
def dml
|
15
15
|
sql_command = "insert into %s.%s (filename) values ('%s')" % [Db.schema_name, Scripts::SCRIPTS, @filename]
|
16
|
-
"psql --command \"%s\" %s" % [sql_command, @db.
|
16
|
+
"psql --command \"%s\" %s" % [sql_command, @db.sanitized_url]
|
17
17
|
end
|
18
18
|
|
19
19
|
end
|
metadata
CHANGED
@@ -1,25 +1,24 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: schema-evolution-manager
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.55
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bryzek
|
8
|
-
autorequire:
|
9
8
|
bindir: bin
|
10
9
|
cert_chain: []
|
11
|
-
date:
|
10
|
+
date: 2025-08-25 00:00:00.000000000 Z
|
12
11
|
dependencies: []
|
13
12
|
description: '["Michael Bryzek"]'
|
14
13
|
email: mbryzek@alum.mit.edu
|
15
14
|
executables:
|
16
|
-
- sem-info
|
17
|
-
- sem-config
|
18
15
|
- sem-add
|
19
|
-
- sem-init
|
20
16
|
- sem-apply
|
21
|
-
- sem-dist
|
22
17
|
- sem-baseline
|
18
|
+
- sem-config
|
19
|
+
- sem-dist
|
20
|
+
- sem-info
|
21
|
+
- sem-init
|
23
22
|
extensions: []
|
24
23
|
extra_rdoc_files: []
|
25
24
|
files:
|
@@ -57,7 +56,6 @@ homepage: https://github.com/gilt/schema-evolution-manager
|
|
57
56
|
licenses:
|
58
57
|
- Apache-2.0
|
59
58
|
metadata: {}
|
60
|
-
post_install_message:
|
61
59
|
rdoc_options: []
|
62
60
|
require_paths:
|
63
61
|
- lib
|
@@ -72,8 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
72
70
|
- !ruby/object:Gem::Version
|
73
71
|
version: '0'
|
74
72
|
requirements: []
|
75
|
-
rubygems_version: 3.
|
76
|
-
signing_key:
|
73
|
+
rubygems_version: 3.7.1
|
77
74
|
specification_version: 4
|
78
75
|
summary: Schema evolution manager is a simple schema migration tool for postgresql
|
79
76
|
databases.
|