prick 0.20.15 → 0.20.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/exe/prick +1 -0
- data/lib/builder/batch.rb +3 -1
- data/lib/builder/builder.rb +0 -2
- data/lib/builder/parser.rb +3 -1
- data/lib/prick/version.rb +1 -1
- data/lib/subcommand/prick-build.rb +20 -12
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69e1bed1482431efd5f5e449ba9d2b3d5cccfef223398e51879aeda7374fd6e1
|
4
|
+
data.tar.gz: 99984a969cb456c6efbf4943f56433d1c207246dfc615956fbd550511c30bfee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7359ccc4a5da931531579431375e94007d7b7c66dc128c1a15c26fce5aa8b206b2ed89b33e9d15054c49f4dc64b61a31ea5647e387c219f5fdd1f0a7eed1fe25
|
7
|
+
data.tar.gz: 3713cb328f4aea15e7ac67d0e40dd7d1ae07e31528368aaf24d634fcd6ffbb91c2b512764a2c82cd01abe7c9aa191c784332196ba9b0f8232c5f4fe5a2b56fff
|
data/exe/prick
CHANGED
data/lib/builder/batch.rb
CHANGED
@@ -134,9 +134,11 @@ module Prick
|
|
134
134
|
delete = builder.clean ? :none : :touched
|
135
135
|
begin
|
136
136
|
conn.execute fox.to_sql(format: :exec, delete: delete)
|
137
|
+
|
138
|
+
# FIXME: Why only in FoxBatch - should be set higher up in the system
|
137
139
|
conn.execute "update prick.versions set built_at = now() at time zone 'UTC'"
|
138
140
|
rescue PG::SyntaxError, PG::Error => ex
|
139
|
-
raise PostgresError, "prick: #{
|
141
|
+
raise PostgresError, "prick: #{ex.message}"
|
140
142
|
end
|
141
143
|
}
|
142
144
|
t_type.emit
|
data/lib/builder/builder.rb
CHANGED
@@ -93,8 +93,6 @@ module Prick
|
|
93
93
|
def execute(conn, create_schemas: schemas)
|
94
94
|
group if batches.nil?
|
95
95
|
conn.exec create_schemas.grep_v("public").map { |schema| "create schema #{schema}" }
|
96
|
-
conn.schema.create("public", authorization: "postgres")
|
97
|
-
conn.exec "grant all on schema public to public"
|
98
96
|
for batch in batches
|
99
97
|
batch.execute
|
100
98
|
end
|
data/lib/builder/parser.rb
CHANGED
@@ -92,6 +92,7 @@ module Prick
|
|
92
92
|
end
|
93
93
|
else
|
94
94
|
name = entry
|
95
|
+
name.sub!(/\$ENVIRONMENT/, Prick.state.environment.to_s)
|
95
96
|
name.sub!(/\/$/, "")
|
96
97
|
if name =~ /^(\S+)\s+(.*)$/ # exe
|
97
98
|
file = $1
|
@@ -111,7 +112,7 @@ module Prick
|
|
111
112
|
when /\.fox$/
|
112
113
|
FoxNode.new(unit, :seed, path)
|
113
114
|
else
|
114
|
-
raise Error, "Unrecognized file type #{File.basename(path)} in #{
|
115
|
+
raise Error, "Unrecognized file type #{File.basename(path)} in #{dir}"
|
115
116
|
end
|
116
117
|
else
|
117
118
|
raise Error, "Can't find #{name} in #{dir} from #{unit}"
|
@@ -121,3 +122,4 @@ module Prick
|
|
121
122
|
end
|
122
123
|
end
|
123
124
|
end
|
125
|
+
|
data/lib/prick/version.rb
CHANGED
@@ -7,7 +7,9 @@ module Prick::SubCommand
|
|
7
7
|
Timer.on! if timer
|
8
8
|
time "Prick::Command#build" do
|
9
9
|
begin
|
10
|
-
super_conn = PgConn.new
|
10
|
+
super_conn = PgConn.new # Used to create new databases (doesn't make a
|
11
|
+
# difference right now as the mikras user is
|
12
|
+
# still a superuser)
|
11
13
|
|
12
14
|
conn = nil
|
13
15
|
builder = nil
|
@@ -18,30 +20,36 @@ module Prick::SubCommand
|
|
18
20
|
else
|
19
21
|
super_conn.rdbms.create database, owner: username
|
20
22
|
conn = PgConn.new(database, username)
|
21
|
-
|
23
|
+
exist = false
|
22
24
|
end
|
23
25
|
|
24
26
|
builder = Prick::Build::Builder.new(conn, builddir)
|
25
27
|
|
26
28
|
if exist
|
27
29
|
if force
|
28
|
-
|
30
|
+
# Drop all schemas but re-creates the public schema
|
31
|
+
super_conn.rdbms.empty!(database)
|
29
32
|
|
30
33
|
else
|
31
|
-
#
|
32
|
-
|
33
|
-
|
34
|
+
# Find schemas to refresh. This includes all schemas in the
|
35
|
+
# database
|
36
|
+
refresh_schemas = conn.schema.list
|
34
37
|
|
35
|
-
#
|
36
|
-
|
37
|
-
|
38
|
-
|
38
|
+
# Find existing keep-schemas
|
39
|
+
keep_schemas = builder.keep_schemas.select { |s| conn.schema.exist?(s) }
|
40
|
+
|
41
|
+
# Remove keep-schemas from list of schemas
|
42
|
+
refresh_schemas -= keep_schemas
|
39
43
|
|
40
44
|
# Eliminate keep schemas from build pool
|
41
|
-
builder.pool.delete_schema(
|
45
|
+
builder.pool.delete_schema(keep_schemas)
|
42
46
|
|
43
47
|
# Drop refresh schemes
|
44
|
-
|
48
|
+
refresh_schemas.each { |schema| conn.schema.drop(schema, cascade: true) }
|
49
|
+
|
50
|
+
# Re-create public schema
|
51
|
+
conn.schema.create("public", authorization: "postgres")
|
52
|
+
conn.exec "grant usage, create on schema public to public"
|
45
53
|
end
|
46
54
|
end
|
47
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: prick
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.20.
|
4
|
+
version: 0.20.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-06-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: semantic
|
@@ -230,7 +230,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
230
230
|
- !ruby/object:Gem::Version
|
231
231
|
version: '0'
|
232
232
|
requirements: []
|
233
|
-
rubygems_version: 3.1.
|
233
|
+
rubygems_version: 3.1.2
|
234
234
|
signing_key:
|
235
235
|
specification_version: 4
|
236
236
|
summary: A release control and management system for postgresql
|