schema-evolution-manager 0.9.37 → 0.9.44

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
- SHA1:
3
- metadata.gz: 2323179e7d2aa302547712caf2caa527d64d4c7f
4
- data.tar.gz: 6d17ecdf2edde433b1f583c661ea2b38b4b3c029
2
+ SHA256:
3
+ metadata.gz: 9e579a1c6bbd83d31417f9a78b9552cd742b458ddbcd8d28a1516ce585a8275d
4
+ data.tar.gz: 54d600c6d4174ddadbc56ed2f3a148632fa5986a288f7dc348db034075d9994c
5
5
  SHA512:
6
- metadata.gz: 7adf83ddb63350627103e13e4cbfa0e116651a22bc1e65e6d67dc7f7708141b5e225f15f9f608fcbbdfb3983365b6cce3544a3ee116aebb253904d2b4d01d54b
7
- data.tar.gz: 75e0ec7dc0e08a6eec8e94ff025a8eaaa8a892dbd2e5477786110b4b3547d01f8ea939b58b95a42924a7a85d90e56e5e65e03c42d3f49102907262c1ba0ac269
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.37
132
+ git checkout 0.9.44
133
133
  ruby ./configure.rb
134
134
  sudo ./install.rb
135
135
 
data/bin/sem-add CHANGED
@@ -23,12 +23,12 @@ scripts_dir = File.join(`pwd`.strip, "scripts")
23
23
  SchemaEvolutionManager::Library.ensure_dir!(scripts_dir)
24
24
 
25
25
  contents = IO.read(file)
26
- now = Time.now.strftime('%Y%m%d-%H%M%S')
26
+ now = Time.now.utc.strftime('%Y%m%d-%H%M%S')
27
27
  target = File.join(scripts_dir, "#{now}.sql")
28
28
 
29
29
  while File.exists?(target)
30
30
  sleep 0.1
31
- now = Time.now.strftime('%Y%m%d-%H%M%S')
31
+ now = Time.now.utc.strftime('%Y%m%d-%H%M%S')
32
32
  target = File.join(scripts_dir, "#{now}.sql")
33
33
  end
34
34
 
data/bin/sem-config CHANGED
@@ -1 +1,3 @@
1
+ #!/usr/bin/env ruby
2
+
1
3
  load File.join(File.dirname(__FILE__), '../lib/schema-evolution-manager.rb')
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
 
@@ -59,7 +59,7 @@ Dir.chdir(lib_dir) do
59
59
  end
60
60
  end
61
61
 
62
- ['CONVENTIONS.md', 'LICENSE', 'README.md', 'VERSION'].each do |filename|
62
+ ['CONVENTIONS.md', 'LICENSE', 'README.md', 'VERSION', 'install.sh'].each do |filename|
63
63
  SchemaEvolutionManager::Library.system_or_error("cp %s %s" % [filename, version_dir])
64
64
  end
65
65
 
@@ -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.37' # 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
@@ -74,7 +74,7 @@ module SchemaEvolutionManager
74
74
 
75
75
  def Version.is_valid?(version_string)
76
76
  Preconditions.check_not_blank(version_string, "version_string cannot be blank")
77
- version_string.match(/^\w*\d+\.\d+\.\d+$/)
77
+ version_string.match(/^\w*\d+\.\d+\.\d+$/) ? true : false
78
78
  end
79
79
 
80
80
  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.37
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: 2018-04-14 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
@@ -55,7 +55,7 @@ files:
55
55
  - template/dev.rb
56
56
  homepage: https://github.com/gilt/schema-evolution-manager
57
57
  licenses:
58
- - Apache 2.0
58
+ - Apache-2.0
59
59
  metadata: {}
60
60
  post_install_message:
61
61
  rdoc_options: []
@@ -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
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