prick 0.20.15 → 0.20.16
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/lib/builder/batch.rb +2 -0
- data/lib/builder/builder.rb +1 -1
- data/lib/prick/version.rb +1 -1
- data/lib/subcommand/prick-build.rb +16 -12
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 20f00d302f4282832c257119bf9bfe5f2d171c9d706ec74bca142681d670a596
|
4
|
+
data.tar.gz: 5facc31ae461bcc1919509d81d71ea4f9244c20fae8e5a693f991b419343d47b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 726d74592d2568c862538ea0692a01067eda7a7ffd3f5dba6b80abea1b3d3a96ae0f11faa5a4ee65792de764a628f4f73691d172f9e095b24b40cba9f140efc8
|
7
|
+
data.tar.gz: 708e3863256205385a418b4ce3436d3639f576fd6700d478b7e11933232187af6bda60988d0a952942cd56351d896835c574b8a31c920b991ac7a663dc89147e
|
data/lib/builder/batch.rb
CHANGED
@@ -134,6 +134,8 @@ 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
141
|
raise PostgresError, "prick: #{error} from #{node.path}"
|
data/lib/builder/builder.rb
CHANGED
@@ -94,7 +94,7 @@ module Prick
|
|
94
94
|
group if batches.nil?
|
95
95
|
conn.exec create_schemas.grep_v("public").map { |schema| "create schema #{schema}" }
|
96
96
|
conn.schema.create("public", authorization: "postgres")
|
97
|
-
conn.exec "grant
|
97
|
+
conn.exec "grant usage, create on schema public to public"
|
98
98
|
for batch in batches
|
99
99
|
batch.execute
|
100
100
|
end
|
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,32 @@ 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
|
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) }
|
45
49
|
end
|
46
50
|
end
|
47
51
|
|