-
-
Notifications
You must be signed in to change notification settings - Fork 229
Expand file tree
/
Copy pathdump-db.mjs
More file actions
32 lines (28 loc) · 602 Bytes
/
dump-db.mjs
File metadata and controls
32 lines (28 loc) · 602 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/usr/bin/env zx
import { spawn } from "child_process";
if (process.env.IN_TESTS === "1") {
process.exit(0);
}
const connectionString = process.env.GM_DBURL;
if (!connectionString) {
console.error(
"This script should only be called from a graphile-migrate action."
);
process.exit(1);
}
spawn(
process.env.PG_DUMP || "pg_dump",
[
"--no-sync",
"--schema-only",
"--no-owner",
"--exclude-schema=graphile_migrate",
"--exclude-schema=graphile_worker",
"--file=../../data/schema.sql",
connectionString,
],
{
stdio: "inherit",
shell: true,
}
);