# |
Mar 11th 2019, 17:19 |
is_null |
hi all, i inherited a cakephp 3.5 project, running on php 7 and mariadb 10.3, any idea what to do to enable migrations to work with tinyint ? it currently fails as such: https://dpaste.de/Ktxk |
# |
Mar 11th 2019, 17:18 |
martin |
never run the process `yes` alone, because it will use 100% of cpu :P |
# |
Mar 11th 2019, 17:15 |
martin |
cake bake model agreements | yes ? :P |
# |
Mar 11th 2019, 17:05 |
tjkalinowski |
cake bake model agreements --force (how to force overwirte all files ????) |
# |
Mar 11th 2019, 16:20 |
tjkalinowski |
:slightly_smiling_face: |
# |
Mar 11th 2019, 16:20 |
jeremyharris |
it happens to all of us! |
# |
Mar 11th 2019, 16:20 |
tjkalinowski |
:( and 45 minuts of searching for error is gone ..... :( |
# |
Mar 11th 2019, 16:19 |
jeremyharris |
@tjkalinowski I think its a typo, you want to use `conditions` (plural) |
# |
Mar 11th 2019, 16:18 |
jeremyharris |
no I don’t think you can add options at that point |
# |
Mar 11th 2019, 16:18 |
slackebot |
<tjkalinowski> |
# |
Mar 11th 2019, 16:18 |
martin |
but you can’t give options to that finder I quess? |
# |
Mar 11th 2019, 16:18 |
martin |
``` $this->hasOne('ClosestStorePrices', [ 'foreignKey' => 'product_id', 'finder' => 'closestPrice', 'className' => 'StorePrices' ]);``` |
# |
Mar 11th 2019, 16:17 |
jeremyharris |
the $q should be the finder query already, and you can stack on it as you please |
# |
Mar 11th 2019, 16:17 |
jeremyharris |
so the finder is defined on the association definition? if so, you can use what I wrote above and skip the finder as it is already applied |
# |
Mar 11th 2019, 16:16 |
martin |
then you will add an extra finder to the association. But I already added that in the model, |
# |
Mar 11th 2019, 16:15 |
jeremyharris |
do you mean something like this? `$query->contain('Association', function ($q) { return $q->find('closestPrice')->where(['something' => 'else']); })` |
# |
Mar 11th 2019, 16:12 |
martin |
but when I want to do a finder that I use like $q->find(‘closestPrice’, [‘forStore’ => 45]); I can’t do that with a contain? where the finder of de association is that finder? |
# |
Mar 11th 2019, 16:07 |
neon1024 |
My guess if you have one slow endpoint |
# |
Mar 11th 2019, 16:07 |
david |
all my tests goes fine, via postman it never never never has failed |
# |
Mar 11th 2019, 16:07 |
neon1024 |
Build a picture using diagnostic tooling |
# |
Mar 11th 2019, 16:07 |
neon1024 |
Add in some logging, check your performance, try siege, test with postman |
# |
Mar 11th 2019, 16:06 |
neon1024 |
What I would suggest would be to get started |
# |
Mar 11th 2019, 16:06 |
neon1024 |
This all sounds like you’ve no idea what’s going on and haven’t started your investigation yet |
# |
Mar 11th 2019, 16:05 |
david |
but I don't know if there is anything I could look for |
# |
Mar 11th 2019, 16:05 |
david |
it seems a server problem, not implementation |
# |
Mar 11th 2019, 16:05 |
david |
not only sometimes randomly... then, app begans to work fine, until the next time it goes slow |
# |
Mar 11th 2019, 16:04 |
david |
no crash, I mean... it should fails always |
# |
Mar 11th 2019, 16:04 |
neon1024 |
Well it wouldn’t crash, but your web service would probably return a code for missing OPTIONS verb |
# |
Mar 11th 2019, 16:03 |
david |
but it was a CORS problem, it should crash always, isn't it? |
# |
Mar 11th 2019, 16:03 |
david |
no, as far as I know |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Then again, the app won’t be a browser I’d guess |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Could be CORS |
# |
Mar 11th 2019, 16:01 |
neon1024 |
Are they doing pre-flight checks? |
# |
Mar 11th 2019, 15:52 |
david |
we have developed an API REST, which works really fast when requesting from postman. An IOS developer consumes the api from a native app, and it works really slow... sometimes. When it works, it works fine, but many times it exceeds the time. Is there any setup which I could check? It seems to be a problem from the app, not the api, but I don't know how to check this. Logs dir is empty. |
# |
Mar 11th 2019, 15:51 |
jeremyharris |
yea, use the second parameter of contain() to add to the query |
# |
Mar 11th 2019, 15:38 |
martin |
hmm if I have a hasone, relation, and I contain that one in query, can I give options for that finder method? |
# |
Mar 11th 2019, 15:22 |
tjkalinowski |
@martin nothing more comes to my mind. |
# |
Mar 11th 2019, 15:22 |
tjkalinowski |
@martin You have to add one filed to table, and then order by this filed. |
# |
Mar 11th 2019, 15:05 |
martin |
just-> |
# |
Mar 11th 2019, 15:02 |
martin |
ok, how do you do that? |
# |
Mar 11th 2019, 15:02 |
neon1024 |
I have a few places where I do that |