Organize directories
This commit is contained in:
parent
8a91c9b89b
commit
4898382f78
433 changed files with 0 additions and 0 deletions
31
packages/metamigo-db/scripts/dump-db.js
Normal file
31
packages/metamigo-db/scripts/dump-db.js
Normal file
|
|
@ -0,0 +1,31 @@
|
|||
const { spawn } = require("child_process");
|
||||
const findWorkspaceRoot = require("find-yarn-workspace-root");
|
||||
|
||||
if (process.env.CI) {
|
||||
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=${findWorkspaceRoot()}/data/schema.sql`,
|
||||
connectionString,
|
||||
],
|
||||
{
|
||||
stdio: "inherit",
|
||||
shell: true,
|
||||
}
|
||||
);
|
||||
Loading…
Add table
Add a link
Reference in a new issue