prick 0.13.0 → 0.14.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/prick/database.rb +17 -1
- data/lib/prick/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: c155692c268326430a0e9225d4a7c156fedd52533114b62fae7e7ce61da01177
|
4
|
+
data.tar.gz: 4e245212208c3ecc518f313cd9f1af709db5ce41b7281c7247a1078293c486de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 38ff771885f6a73a20f36985403cb61a63fc2f025c20f92bb1dea4cb2ba047f908e48c4a564a50b707594d32199a87f796e0640135f6f0da5a521fe572c70cdb
|
7
|
+
data.tar.gz: 79641d89e168fe1be4d7493aed420fd40cd71cfb29ac98c359c34f82457bd1b7c265883e83cf661c29ff1ea6437bf1a087a652987409221cc4c439768b480922
|
data/lib/prick/database.rb
CHANGED
@@ -59,7 +59,23 @@ module Prick
|
|
59
59
|
@version = nil
|
60
60
|
end
|
61
61
|
|
62
|
-
|
62
|
+
# Hollow-out a database without dropping it. This is useful compared to a
|
63
|
+
# simple drop database since it wont block on other sessions wont block
|
64
|
+
def clean()
|
65
|
+
if exist?
|
66
|
+
schemas = Rdbms.select_values(
|
67
|
+
"postgres",
|
68
|
+
"select nspname from pg_namespace where nspowner != 10")
|
69
|
+
for schema in schemas
|
70
|
+
Rdbms.exec_sql(name, "drop schema \"#{schema}\" cascade")
|
71
|
+
end
|
72
|
+
Rdbms.exec_sql(name, "drop schema if exists public cascade")
|
73
|
+
Rdbms.exec_sql(name, "create schema public authorization postgres")
|
74
|
+
Rdbms.exec_sql(name, "grant usage, create on schema public to public")
|
75
|
+
else
|
76
|
+
create
|
77
|
+
end
|
78
|
+
end
|
63
79
|
|
64
80
|
def to_s() name end
|
65
81
|
end
|
data/lib/prick/version.rb
CHANGED
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.
|
4
|
+
version: 0.14.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Claus Rasmussen
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2021-03-
|
11
|
+
date: 2021-03-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: shellopts
|