Skip to content

Commit c54d53d

Browse files
committed
add --apply and --config-inline "legacy_ignore_quotes: false" by default
1 parent b6f77df commit c54d53d

File tree

2 files changed

+19
-13
lines changed

2 files changed

+19
-13
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"version": "1.0.0",
44
"description": "GitHub Action to preview schema changes using sqldef",
55
"main": "dist/index.js",
6+
"private": true,
67
"scripts": {
78
"build": "tsc",
89
"format": "prettier --write **/*.ts",
@@ -18,7 +19,7 @@
1819
"database",
1920
"schema"
2021
],
21-
"author": "",
22+
"author": "sqldef team",
2223
"license": "MIT",
2324
"dependencies": {
2425
"@actions/core": "latest",

src/main.ts

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ async function getSchemaFromBranch(branch: string, schemaFile: string): Promise<
179179
return tempFile;
180180
}
181181

182-
async function runSqldef(binaryPath: string, config: CommandConfig): Promise<string> {
182+
async function runSqldef(sqldefPath: string, config: CommandConfig): Promise<string> {
183183
let output = "";
184184
let stderr = "";
185185

@@ -191,19 +191,24 @@ async function runSqldef(binaryPath: string, config: CommandConfig): Promise<str
191191
}
192192
Object.assign(execEnv, config.env);
193193

194-
const exitCode = await exec.exec(binaryPath, config.args, {
195-
env: execEnv,
196-
silent: false,
197-
ignoreReturnCode: true,
198-
listeners: {
199-
stdout: (data: Buffer) => {
200-
output += data.toString();
201-
},
202-
stderr: (data: Buffer) => {
203-
stderr += data.toString();
194+
// apply the schema to the database
195+
const exitCode = await exec.exec(
196+
sqldefPath,
197+
["--config-inline", "legacy_ignore_quotes: false", "--apply", ...config.args],
198+
{
199+
env: execEnv,
200+
silent: false,
201+
ignoreReturnCode: true,
202+
listeners: {
203+
stdout: (data: Buffer) => {
204+
output += data.toString();
205+
},
206+
stderr: (data: Buffer) => {
207+
stderr += data.toString();
208+
},
204209
},
205210
},
206-
});
211+
);
207212

208213
if (exitCode !== 0) {
209214
if (stderr) {

0 commit comments

Comments
 (0)