dump_hook 0.0.5 → 0.0.6
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/dump_hook/version.rb +1 -1
- data/lib/dump_hook.rb +6 -2
- 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: 95cef8d6a506cf536c1ae3059ec9bbc9de927f04b37c3af523feffa7276ab4c2
|
|
4
|
+
data.tar.gz: 25cb1e3938647e8b56b8be8e0338fa00331a9ec614ca27ee3af8381e5fb80e77
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c4dfb91ed9959ccce4c09bf903c729ed0cc86c57fd8c81bb217944f3756989d24982d04236b82766f0e7643c87b92325015624d195fdfcfa0b96a04452b190a6
|
|
7
|
+
data.tar.gz: b922d2df7f844690d8477c2196d9b83424184d0ad2e007da5563832cbd5adcc1b97e8c0173fe79cc69dc756bbaaad1540b00a0d4a8d5c2666f1c162df10d3513
|
data/lib/dump_hook/version.rb
CHANGED
data/lib/dump_hook.rb
CHANGED
|
@@ -60,7 +60,7 @@ module DumpHook
|
|
|
60
60
|
when 'postgres'
|
|
61
61
|
args = ['-a', '-x', '-O', '-f', filename, '-Fc', '-T', 'schema_migrations', '-T', 'ar_internal_metadata']
|
|
62
62
|
args.concat(pg_connection_args)
|
|
63
|
-
Kernel.system("pg_dump", *args)
|
|
63
|
+
Kernel.system(pg_env, "pg_dump", *args)
|
|
64
64
|
when 'mysql'
|
|
65
65
|
args = mysql_connection_args
|
|
66
66
|
args << "--compress"
|
|
@@ -77,7 +77,7 @@ module DumpHook
|
|
|
77
77
|
args = ['--single-transaction']
|
|
78
78
|
args.concat(pg_connection_args)
|
|
79
79
|
args << filename
|
|
80
|
-
Kernel.system("pg_restore", *args)
|
|
80
|
+
Kernel.system(pg_env, "pg_restore", *args)
|
|
81
81
|
when 'mysql'
|
|
82
82
|
args = mysql_connection_args
|
|
83
83
|
args.concat ["-e", "source #{filename}"]
|
|
@@ -116,6 +116,10 @@ module DumpHook
|
|
|
116
116
|
args
|
|
117
117
|
end
|
|
118
118
|
|
|
119
|
+
def pg_env
|
|
120
|
+
settings.password ? { 'PGPASSWORD' => settings.password } : {}
|
|
121
|
+
end
|
|
122
|
+
|
|
119
123
|
def recreate?(filename)
|
|
120
124
|
DumpHook.recreate ||= []
|
|
121
125
|
result = (settings.recreate || ENV["DUMP_HOOK"] == "recreate") && !DumpHook.recreate.include?(filename)
|