Skip to content

Commit 2d4251f

Browse files
committed
add --apply as a sqldef v4 mgiration
1 parent b6f77df commit 2d4251f

File tree

6 files changed

+12
-6
lines changed

6 files changed

+12
-6
lines changed

examples/mssql.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
enable_drop: true
1+
legacy_ignore_quotes: false
2+
enable_drop: true

examples/mysqldef.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
enable_drop: true
1+
legacy_ignore_quotes: false
2+
enable_drop: true

examples/psqldef.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
1+
legacy_ignore_quotes: false
12
enable_drop: true
23
create_index_concurrently: true

examples/sqlite3def.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1-
enable_drop: true
1+
legacy_ignore_quotes: false
2+
enable_drop: true

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: 3 additions & 2 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,7 +191,8 @@ 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, {
194+
// apply the schema to the database
195+
const exitCode = await exec.exec(sqldefPath, ["--apply", ...config.args], {
195196
env: execEnv,
196197
silent: false,
197198
ignoreReturnCode: true,

0 commit comments

Comments
 (0)