Skip to content

Commit 0d369b4

Browse files
committed
Prevent mysqldump to lock tables
1 parent 9846e99 commit 0d369b4

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

dist/database.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ const getDbDumpZipCommands = ({
116116
gzipFilePath,
117117
isMysql8 = false
118118
}) => // Dump and zip the db - this can make it around 9 times smaller
119-
`mysqldump --host='${host}' --port='${port}' --user='${user}' --password='${password}' --no-tablespaces ${isMysql8 ? '--column-statistics=0' : ''} ${database} | gzip > '${gzipFilePath}'`;
119+
`mysqldump --host='${host}' --port='${port}' --user='${user}' --password='${password}' --single-transaction --lock-tables=false --no-tablespaces ${isMysql8 ? '--column-statistics=0' : ''} ${database} | gzip > '${gzipFilePath}'`;
120120

121121
exports.getDbDumpZipCommands = getDbDumpZipCommands;
122122

package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "swiff",
3-
"version": "1.5.6",
3+
"version": "1.5.7",
44
"description": "Swiff saves you time with common SSH tasks during the development of websites/apps",
55
"main": "index.js",
66
"scripts": {

src/database.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ const getDbDumpZipCommands = ({
7272
isMysql8 = false
7373
}) =>
7474
// Dump and zip the db - this can make it around 9 times smaller
75-
`mysqldump --host='${host}' --port='${port}' --user='${user}' --password='${password}' --no-tablespaces ${isMysql8?'--column-statistics=0':''} ${database} | gzip > '${gzipFilePath}'`
75+
`mysqldump --host='${host}' --port='${port}' --user='${user}' --password='${password}' --single-transaction --lock-tables=false --no-tablespaces ${isMysql8?'--column-statistics=0':''} ${database} | gzip > '${gzipFilePath}'`
7676

7777
const checkForDb = async ({ dbFilePath, sshConn }) => {
7878
let errorMessage

0 commit comments

Comments
 (0)