You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I recently updated the dependencies, after which all update actions with Lucid ORM Models that use a self assigned PK in combination with a non-conventional column name suddenly started to fail and at this point I'm not sure if it's a bug or I'm just missing something.
The following code works fine with recent core & @adonisjs/lucid <= 15.0.1 on Node v16.11.1:
Assuming there's an existing row in the migrated tests table with ID "dfebfab7-5932-47a3-8ca2-7f7d9717fa13" triggering node ace test successfully updates the comment to "Test". But upgrading @adonisjs/lucid to any version >= 15.0.2 and running the same code will result in the following exception, both on MariaDB/MySQL as well as SQLite:
$ node ace test
Exception: ".where" expects value to be defined, but undefined is passed
at /mnt/d/lucid-test-fresh/commands/Test.ts(Test.run):35
31 const { default: Test } = await import('App/Models/Test')
32
33 const testRow = await Test.findOrFail('dfebfab7-5932-47a3-8ca2-7f7d9717fa13')
34 testRow.merge({ comment: 'Test' })
35 await testRow.save()
36 }
37 }
38
1 ModelQueryBuilder.validateWhereSingleArgument
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/lucid/build/src/Database/QueryBuilder/Chainable.js:150
2 ModelQueryBuilder.where
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/lucid/build/src/Database/QueryBuilder/Chainable.js:327
3 Proxy.$getQueryFor
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/lucid/build/src/Orm/BaseModel/index.js:1549
4 Adapter.update
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/lucid/build/src/Orm/Adapter/index.js:73
5 Proxy.save
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/lucid/build/src/Orm/BaseModel/index.js:1385
6 Test.exec
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/ace/build/src/BaseCommand/index.js:142
7 Kernel.handle
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/ace/build/src/Kernel/index.js:496
8 App.handle
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/core/build/src/Ignitor/Ace/App/index.js:286
9 Ace.handle
/mnt/d/lucid-test-fresh/node_modules/@adonisjs/core/build/src/Ignitor/Ace/index.js:33
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Hello there
I recently updated the dependencies, after which all update actions with Lucid ORM Models that use a self assigned PK in combination with a non-conventional column name suddenly started to fail and at this point I'm not sure if it's a bug or I'm just missing something.
The following code works fine with recent core &
@adonisjs/lucid
<= 15.0.1 on Node v16.11.1:app/Models/Test.ts
database/migrations/XXXXX_tests.ts
commands/Test.ts
Assuming there's an existing row in the migrated
tests
table with ID "dfebfab7-5932-47a3-8ca2-7f7d9717fa13" triggeringnode ace test
successfully updates thecomment
to "Test". But upgrading@adonisjs/lucid
to any version >= 15.0.2 and running the same code will result in the following exception, both on MariaDB/MySQL as well as SQLite:Any feedback is appreciated!
Beta Was this translation helpful? Give feedback.
All reactions