mirror of
https://github.com/strapi/strapi.git
synced 2025-09-25 16:29:34 +00:00
fix: use getConnection for raw query
This commit is contained in:
parent
9ea3b6990e
commit
fd59fcea30
1
.github/actions/run-api-tests/script.sh
vendored
1
.github/actions/run-api-tests/script.sh
vendored
@ -7,7 +7,6 @@ fi
|
|||||||
|
|
||||||
export ENV_PATH="$(pwd)/test-apps/api/.env"
|
export ENV_PATH="$(pwd)/test-apps/api/.env"
|
||||||
export JWT_SECRET="aSecret"
|
export JWT_SECRET="aSecret"
|
||||||
export DATABASE_SCHEMA="myschema"
|
|
||||||
|
|
||||||
opts=($DB_OPTIONS)
|
opts=($DB_OPTIONS)
|
||||||
|
|
||||||
|
4
.github/workflows/tests.yml
vendored
4
.github/workflows/tests.yml
vendored
@ -195,8 +195,6 @@ jobs:
|
|||||||
- uses: ./.github/actions/run-api-tests
|
- uses: ./.github/actions/run-api-tests
|
||||||
with:
|
with:
|
||||||
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
|
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
|
||||||
env:
|
|
||||||
DATABASE_SCHEMA: myschema
|
|
||||||
|
|
||||||
api_ce_mysql:
|
api_ce_mysql:
|
||||||
if: needs.changes.outputs.backend == 'true'
|
if: needs.changes.outputs.backend == 'true'
|
||||||
@ -334,8 +332,6 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
|
dbOptions: '--dbclient=postgres --dbhost=localhost --dbport=5432 --dbname=strapi_test --dbusername=strapi --dbpassword=strapi'
|
||||||
runEE: true
|
runEE: true
|
||||||
env:
|
|
||||||
DATABASE_SCHEMA: myschema
|
|
||||||
|
|
||||||
api_ee_mysql:
|
api_ee_mysql:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
@ -248,7 +248,8 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
|
|||||||
const joinTableName = addSchema(joinTable.name);
|
const joinTableName = addSchema(joinTable.name);
|
||||||
|
|
||||||
// raw query as knex doesn't allow updating from a subquery
|
// raw query as knex doesn't allow updating from a subquery
|
||||||
await db.connection
|
await db
|
||||||
|
.getConnection()
|
||||||
.raw(
|
.raw(
|
||||||
`UPDATE ?? as a
|
`UPDATE ?? as a
|
||||||
SET ?? = b.src_order
|
SET ?? = b.src_order
|
||||||
@ -300,7 +301,8 @@ const cleanOrderColumns = async ({ id, attribute, db, inverseRelIds, transaction
|
|||||||
const joinTableName = addSchema(joinTable.name);
|
const joinTableName = addSchema(joinTable.name);
|
||||||
|
|
||||||
// raw query as knex doesn't allow updating from a subquery
|
// raw query as knex doesn't allow updating from a subquery
|
||||||
await db.connection
|
await db
|
||||||
|
.getConnection()
|
||||||
.raw(
|
.raw(
|
||||||
`UPDATE ?? as a
|
`UPDATE ?? as a
|
||||||
SET ?? = b.inv_order
|
SET ?? = b.inv_order
|
||||||
|
Loading…
x
Reference in New Issue
Block a user