schema-evolution-manager 0.9.46 → 0.9.47
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/bin/sem-add +2 -2
- data/bin/sem-dist +1 -1
- data/bin/sem-init +3 -3
- data/lib/schema-evolution-manager/db.rb +2 -2
- data/lib/schema-evolution-manager/install_template.rb +2 -2
- data/lib/schema-evolution-manager/library.rb +1 -1
- data/lib/schema-evolution-manager/migration_file.rb +1 -1
- data/lib/schema-evolution-manager/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ed6b170d492bc54dae6e23bec8915bc63ee60cf623cc58d7fe501513e5ac51cb
|
4
|
+
data.tar.gz: d8cc588c9fdbf909b7f74d0caf5733f2e19fb42904ed5162e884fdca07e520a4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c49a71d7e017ba6a8a2b16dc817e7e02df007e2f715a102daf9d291beb9085145d5ec2fd9da1f769c169df7aef8bdec968d7bda3ce597bf61ec2f9efdac6a4af
|
7
|
+
data.tar.gz: 0b7fafcd88dab54fbdfab0bed71763c5c2cfc206514f78bbf25e73cc687f6882282b102729958b90b0775ebce993d2fb0a95c80d78545af606d8b7ab299b10b9
|
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.47
|
137
137
|
ruby ./configure.rb
|
138
138
|
sudo ./install.rb
|
139
139
|
|
data/bin/sem-add
CHANGED
@@ -16,7 +16,7 @@ if file.to_s.strip == ""
|
|
16
16
|
SchemaEvolutionManager::RdocUsage.printAndExit(1)
|
17
17
|
end
|
18
18
|
|
19
|
-
SchemaEvolutionManager::Preconditions.check_state(File.
|
19
|
+
SchemaEvolutionManager::Preconditions.check_state(File.exist?(file), "File[#{file}] could not be found")
|
20
20
|
SchemaEvolutionManager::Preconditions.check_state(file.match(/\.sql/i), "File[#{file}] must end with .sql")
|
21
21
|
|
22
22
|
scripts_dir = File.join(`pwd`.strip, "scripts")
|
@@ -26,7 +26,7 @@ contents = IO.read(file)
|
|
26
26
|
now = Time.now.utc.strftime('%Y%m%d-%H%M%S')
|
27
27
|
target = File.join(scripts_dir, "#{now}.sql")
|
28
28
|
|
29
|
-
while File.
|
29
|
+
while File.exist?(target)
|
30
30
|
sleep 0.1
|
31
31
|
now = Time.now.utc.strftime('%Y%m%d-%H%M%S')
|
32
32
|
target = File.join(scripts_dir, "#{now}.sql")
|
data/bin/sem-dist
CHANGED
data/bin/sem-init
CHANGED
@@ -54,7 +54,7 @@ Dir.chdir(args.dir) do
|
|
54
54
|
wrappers = []
|
55
55
|
Dir.glob("#{template_dir}/*").each do |path|
|
56
56
|
wrapper = File.basename(path)
|
57
|
-
if !File.
|
57
|
+
if !File.exist?(wrapper)
|
58
58
|
puts "Creating wrapper script #{wrapper}"
|
59
59
|
copy_file(path, wrapper, subs)
|
60
60
|
SchemaEvolutionManager::Library.system_or_error("chmod +x #{wrapper}")
|
@@ -67,14 +67,14 @@ Dir.chdir(args.dir) do
|
|
67
67
|
end
|
68
68
|
|
69
69
|
readme = "README.md"
|
70
|
-
if !File.
|
70
|
+
if !File.exist?(readme)
|
71
71
|
puts "Creating #{readme}"
|
72
72
|
copy_file("schema-evolution-manager/template/README.md", "README.md", subs)
|
73
73
|
SchemaEvolutionManager::Library.system_or_error("git add #{readme}")
|
74
74
|
SchemaEvolutionManager::Library.system_or_error("git commit -m 'Adding README.md' README.md")
|
75
75
|
end
|
76
76
|
|
77
|
-
if !File.
|
77
|
+
if !File.exist?("scripts")
|
78
78
|
SchemaEvolutionManager::Library.system_or_error("mkdir scripts")
|
79
79
|
SchemaEvolutionManager::Library.system_or_error("touch scripts/.exists")
|
80
80
|
SchemaEvolutionManager::Library.system_or_error("git add scripts/.exists")
|
@@ -67,7 +67,7 @@ module SchemaEvolutionManager
|
|
67
67
|
# executes sql commands from a file in a single transaction
|
68
68
|
def psql_file(filename, path)
|
69
69
|
Preconditions.assert_class(path, String)
|
70
|
-
Preconditions.check_state(File.
|
70
|
+
Preconditions.check_state(File.exist?(path), "File[%s] not found" % path)
|
71
71
|
|
72
72
|
options = Db.attribute_values(path).join(" ")
|
73
73
|
|
@@ -83,7 +83,7 @@ module SchemaEvolutionManager
|
|
83
83
|
result = `#{command} > #{output} 2>&1`.strip
|
84
84
|
status = $?
|
85
85
|
if status.to_i > 0
|
86
|
-
errors = File.
|
86
|
+
errors = File.exist?(output) ? IO.read(output) : result
|
87
87
|
raise ScriptError.new(self, filename, path, errors)
|
88
88
|
end
|
89
89
|
end
|
@@ -47,7 +47,7 @@ SchemaEvolutionManager::Library.ensure_dir!(version_dir)
|
|
47
47
|
SchemaEvolutionManager::Library.ensure_dir!(bin_dir)
|
48
48
|
|
49
49
|
Dir.chdir(lib_dir) do
|
50
|
-
if File.
|
50
|
+
if File.exist?("schema-evolution-manager")
|
51
51
|
if File.symlink?("schema-evolution-manager")
|
52
52
|
SchemaEvolutionManager::Library.system_or_error("rm schema-evolution-manager")
|
53
53
|
SchemaEvolutionManager::Library.system_or_error("ln -s %s %s" % [version_name, 'schema-evolution-manager'])
|
@@ -89,7 +89,7 @@ end
|
|
89
89
|
|
90
90
|
# Overrwrite bin/sem-config with proper location of lib dir
|
91
91
|
init_file = File.join(version_dir, "bin/sem-config")
|
92
|
-
SchemaEvolutionManager::Preconditions.check_state(File.
|
92
|
+
SchemaEvolutionManager::Preconditions.check_state(File.exist?(init_file), "Init file[%s] not found" % init_file)
|
93
93
|
File.open(init_file, "w") do |out|
|
94
94
|
out << "load File.join('%s')\n" % File.join(version_dir, 'lib/schema-evolution-manager.rb')
|
95
95
|
end
|
@@ -48,7 +48,7 @@ module SchemaEvolutionManager
|
|
48
48
|
|
49
49
|
def initialize(path)
|
50
50
|
@path = path
|
51
|
-
Preconditions.check_state(File.
|
51
|
+
Preconditions.check_state(File.exist?(@path), "File[#{@path}] does not exist")
|
52
52
|
@attribute_values = parse_attribute_values
|
53
53
|
end
|
54
54
|
|
@@ -60,7 +60,7 @@ module SchemaEvolutionManager
|
|
60
60
|
# Reads the current version (from the VERSION FILE), returning an
|
61
61
|
# instance of the Version class
|
62
62
|
def Version.read
|
63
|
-
Preconditions.check_state(File.
|
63
|
+
Preconditions.check_state(File.exist?(VERSION_FILE), "Version file at path[%s] not found" % VERSION_FILE)
|
64
64
|
version = IO.read(VERSION_FILE).strip
|
65
65
|
Version.parse(version)
|
66
66
|
end
|
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.
|
4
|
+
version: 0.9.47
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Bryzek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-26 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: '["Michael Bryzek"]'
|
14
14
|
email: mbryzek@alum.mit.edu
|