schema-evolution-manager 0.9.43 → 0.9.44

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
- SHA1:
3
- metadata.gz: cd9e21d060217a24d30ac88e86de27280f3648c5
4
- data.tar.gz: 3da1503dcd5e934d5d67e1a9dac1fe898273d74d
2
+ SHA256:
3
+ metadata.gz: 9e579a1c6bbd83d31417f9a78b9552cd742b458ddbcd8d28a1516ce585a8275d
4
+ data.tar.gz: 54d600c6d4174ddadbc56ed2f3a148632fa5986a288f7dc348db034075d9994c
5
5
  SHA512:
6
- metadata.gz: 97ba2a7957365a06fadc2530cc3512da4d9c59c56e0fc62a9b5c86f16816cdfe608bc8d412bb22dc8c3f4a4cd06b2538ceeff5a0e07264ba7d337e147bf8bd89
7
- data.tar.gz: 38279cc263db00039735ddc6d286b895e079d1b6ab75e351ee889589fad7f21cf10a58e1242b3eff428258dcce4c9f8fa6364fb2c988227b39f196bd8949ae95
6
+ metadata.gz: 2c88ebbd3d1447a5d7798cd7ebaa0c67205f84d408b830cb7200078322f67a3e147f75e620bf437e525d3decc38ca0f884dc7e71bcf64ce46630fee4bf523181
7
+ data.tar.gz: 555a38f1b93184951d6a483c0a056756e3a634eb9608389332affa665225e675ead15ed2b40e83481b3b2fc43aac64fcbe8b7cc2bf6b7c29243edb99660ec0da
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- [![Build Status](https://travis-ci.org/mbryzek/schema-evolution-manager.svg?branch=master)](https://travis-ci.org/mbryzek/schema-evolution-manager)
1
+ [![Build Status](https://travis-ci.org/mbryzek/schema-evolution-manager.svg?branch=main)](https://travis-ci.org/mbryzek/schema-evolution-manager)
2
2
 
3
3
  # Schema Evolution Manager (sem)
4
4
 
@@ -129,7 +129,7 @@ There are two ways to install schema evolution manager:
129
129
 
130
130
  git clone git://github.com/mbryzek/schema-evolution-manager.git
131
131
  cd schema-evolution-manager
132
- git checkout 0.9.43
132
+ git checkout 0.9.44
133
133
  ruby ./configure.rb
134
134
  sudo ./install.rb
135
135
 
data/bin/sem-init CHANGED
@@ -89,7 +89,8 @@ Dir.chdir(args.dir) do
89
89
  end
90
90
 
91
91
  if SchemaEvolutionManager::Library.git_has_remote?
92
- SchemaEvolutionManager::Library.system_or_error("git push origin master")
92
+ branch = SchemaEvolutionManager::Library.system_or_error("git symbolic-ref --short HEAD")
93
+ SchemaEvolutionManager::Library.system_or_error("git push origin #{branch}")
93
94
  end
94
95
 
95
96
  end
@@ -15,7 +15,8 @@ module SchemaEvolutionManager
15
15
  :url => "The connection string for the psql database",
16
16
  :dir => "Path to a directory",
17
17
  :tag => "A git tag (e.g. 0.0.1)",
18
- :prefix => "Configure installer to use this prefix"
18
+ :prefix => "Configure installer to use this prefix",
19
+ :set => "Passthrough for postgresql --set argument"
19
20
  }
20
21
 
21
22
  FLAGS_NO_ARGUMENTS = {
@@ -26,7 +27,7 @@ module SchemaEvolutionManager
26
27
  }
27
28
  end
28
29
 
29
- attr_reader :artifact_name, :host, :port, :name, :prefix, :url, :user, :dir, :dry_run, :tag, :password
30
+ attr_reader :artifact_name, :host, :port, :name, :prefix, :url, :user, :dir, :dry_run, :tag, :password, :set
30
31
 
31
32
  # args: Actual string arguments
32
33
  # :required => list of parameters that are required
@@ -60,6 +61,7 @@ module SchemaEvolutionManager
60
61
  @user = found_arguments.delete(:user)
61
62
  @dir = found_arguments.delete(:dir)
62
63
  @tag = found_arguments.delete(:tag)
64
+ @set = found_arguments.delete(:set)
63
65
 
64
66
  @dry_run = found_arguments.delete(:dry_run)
65
67
  @password = found_arguments.delete(:password)
@@ -7,6 +7,10 @@ module SchemaEvolutionManager
7
7
  def initialize(url, opts={})
8
8
  @url = Preconditions.check_not_blank(url, "url cannot be blank")
9
9
  password = opts.delete(:password)
10
+
11
+ set = opts.delete(:set).to_s.strip
12
+ @psql_executable_with_options = set.empty? ? "psql" : "psql --set='%s'" % set
13
+
10
14
  Preconditions.assert_empty_opts(opts)
11
15
  connection_data = ConnectionData.parse_url(@url)
12
16
 
@@ -28,7 +32,7 @@ module SchemaEvolutionManager
28
32
  # executes a simple sql command.
29
33
  def psql_command(sql_command)
30
34
  Preconditions.assert_class(sql_command, String)
31
- command = "psql --no-align --tuples-only --no-psqlrc --command \"%s\" %s" % [sql_command, @url]
35
+ command = "#{@psql_executable_with_options} --no-align --tuples-only --no-psqlrc --command \"%s\" %s" % [sql_command, @url]
32
36
  Library.system_or_error(command)
33
37
  end
34
38
 
@@ -71,7 +75,7 @@ module SchemaEvolutionManager
71
75
  out << IO.read(path)
72
76
  end
73
77
 
74
- command = "psql --file \"%s\" #{options} %s" % [tmp, @url]
78
+ command = "#{@psql_executable_with_options} --file \"%s\" #{options} %s" % [tmp, @url]
75
79
 
76
80
  Library.with_temp_file do |output|
77
81
  result = `#{command} > #{output} 2>&1`.strip
@@ -94,7 +98,7 @@ module SchemaEvolutionManager
94
98
  # Db. Exists if invalid config.
95
99
  def Db.parse_command_line_config(arg_string)
96
100
  Preconditions.assert_class(arg_string, String)
97
- args = Args.new(arg_string, :optional => ['url', 'host', 'user', 'name', 'port'])
101
+ args = Args.new(arg_string, :optional => ['url', 'host', 'user', 'name', 'port', 'set'])
98
102
  Db.from_args(args)
99
103
  end
100
104
 
@@ -104,12 +108,13 @@ module SchemaEvolutionManager
104
108
  password = opts.delete(:password)
105
109
  Preconditions.assert_empty_opts(opts)
106
110
 
111
+ options = { :password => password, :set => args.set }
107
112
  if args.url
108
- Db.new(args.url, :password => password)
113
+ Db.new(args.url, options)
109
114
  else
110
115
  base = "%s:%s/%s" % [args.host || "localhost", args.port || ConnectionData::DEFAULT_PORT, args.name]
111
116
  url = args.user ? "%s@%s" % [args.user, base] : base
112
- Db.new("postgres://" + url, :password => password)
117
+ Db.new("postgres://" + url, options)
113
118
  end
114
119
  end
115
120
 
@@ -1,9 +1,12 @@
1
+ # File automatically created and updated by util/create-release.rb
1
2
  module SchemaEvolutionManager
2
3
 
3
- module SemVersion
4
+ module SemVersion
4
5
 
5
- VERSION = '0.9.43' # Automatically updated by util/create-release.rb
6
+ VERSION ||= '0.9.43'
6
7
 
7
- end
8
+ end
9
+
10
+ end
8
11
 
9
12
  end
data/template/README.md CHANGED
@@ -1,9 +1,9 @@
1
1
  To add a new database migration script:
2
2
 
3
- 1. Make sure you have head of master:
4
- git checkout master
3
+ 1. Make sure you have head of main:
4
+ git checkout main
5
5
  git fetch
6
- git rebase origin/master
6
+ git rebase origin/main
7
7
 
8
8
  2. Create a local branch for your change
9
9
  git checkout -b tmp
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: schema-evolution-manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.43
4
+ version: 0.9.44
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Bryzek
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-03-16 00:00:00.000000000 Z
11
+ date: 2021-03-23 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: '["Michael Bryzek"]'
14
14
  email: mbryzek@alum.mit.edu
@@ -72,8 +72,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
72
72
  - !ruby/object:Gem::Version
73
73
  version: '0'
74
74
  requirements: []
75
- rubyforge_project:
76
- rubygems_version: 2.5.2.3
75
+ rubygems_version: 3.0.3
77
76
  signing_key:
78
77
  specification_version: 4
79
78
  summary: Schema evolution manager is a simple schema migration tool for postgresql