We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d17f5b3 commit a4f56bfCopy full SHA for a4f56bf
src/commands/reset.ts
@@ -36,11 +36,17 @@ export async function _reset(
36
console.log(
37
`graphile-migrate${logSuffix}: dropped database '${databaseName}'`,
38
);
39
- await pgClient.query(
40
- `CREATE DATABASE ${escapeIdentifier(
41
- databaseName,
42
- )} OWNER ${escapeIdentifier(databaseOwner)};`,
43
- );
+ try {
+ await pgClient.query(
+ `CREATE DATABASE ${escapeIdentifier(
+ databaseName,
+ )} OWNER ${escapeIdentifier(databaseOwner)};`,
44
+ );
45
+ } catch (e) {
46
+ throw new Error(
47
+ `Failed to create database '${databaseName}' with owner '${databaseOwner}': ${e.message}`,
48
49
+ }
50
await pgClient.query(
51
`REVOKE ALL ON DATABASE ${escapeIdentifier(databaseName)} FROM PUBLIC;`,
52
0 commit comments