# |
May 26th 2017, 15:11 |
styks1987 |
not with the ORM but in regular sequel. I get 3 results for both > and < |
# |
May 26th 2017, 15:10 |
hmic |
but only one result? |
# |
May 26th 2017, 15:09 |
styks1987 |
that gives me the lowest value |
# |
May 26th 2017, 15:09 |
hmic |
you need > OtherBids.amount i guess? |
# |
May 26th 2017, 15:08 |
styks1987 |
eventually I need to find listings where matching this information but this test is just a proof that the join works as expected |
# |
May 26th 2017, 15:07 |
styks1987 |
hmic: http://paste.debian.net/943260/ |
# |
May 26th 2017, 15:06 |
hmic |
what does the generated sql look like? |
# |
May 26th 2017, 15:06 |
hmic |
the trick is only required if you want the highest bid from multiple users. if you only need the highest bid from one given user, thats way more straight forward |
# |
May 26th 2017, 15:06 |
styks1987 |
aren’t they essentially the same thing? Join is just clearer to me for this test |
# |
May 26th 2017, 15:05 |
styks1987 |
When I debug the query and run in sql pro it works, but the cake orm keeps returning all 3 bids instead of the highest one |
# |
May 26th 2017, 15:05 |
hmic |
i would have thought of leftJoinWith instead |
# |
May 26th 2017, 15:04 |
styks1987 |
http://paste.debian.net/943259/ |
# |
May 26th 2017, 15:04 |
styks1987 |
hmic: Thank you for your help earlier, however, I believe I am having an issue getting this to work through the cake ORM. |
# |
May 26th 2017, 14:53 |
spriz |
any crud users have have a minute to test something with me? :slightly_smiling_face: |
# |
May 26th 2017, 14:32 |
jeremyharris |
pretty much |
# |
May 26th 2017, 14:32 |
rudy1976s |
thank you all |
# |
May 26th 2017, 14:32 |
rudy1976s |
@jeremyharris so I can almost do anything if the registry is available at that time |
# |
May 26th 2017, 14:31 |
jeremyharris |
@rudy1976s in the migration file you can load up the table registry and do finds and such if you need to |
# |
May 26th 2017, 14:30 |
rudy1976s |
I also need to make conditional work on my migrations: I need to add some columns only if they are not |
# |
May 26th 2017, 14:30 |
spriz |
@jeremyharris we tend to put that as raw sql in the migrations |
# |
May 26th 2017, 14:29 |
jeremyharris |
yeah it’s just annoying when you want to seed the database with some defaults (say I add a table via migrations and want default records in there). End up putting a bunch of extra stuff in the migrations |
# |
May 26th 2017, 14:29 |
rudy1976s |
AH ok, |
# |
May 26th 2017, 14:28 |
spriz |
https://en.wikipedia.org/wiki/Database_seeding |
# |
May 26th 2017, 14:28 |
spriz |
Aye, point is seeds aren't one-off things like migrations |
# |
May 26th 2017, 14:28 |
jeremyharris |
didn’t want to offend anyone |
# |
May 26th 2017, 14:28 |
jeremyharris |
I was gonna say “probably hand-rolled” :P |
# |
May 26th 2017, 14:27 |
jeremyharris |
I think phinx seeds run each time like migrations do… which is annoying. do laravel seeds run even if they’ve run before |
# |
May 26th 2017, 14:27 |
rudy1976s |
@sprix what is “seeds” ? |
# |
May 26th 2017, 14:27 |
spriz |
as with everything else, they roll their own implementation ,:( |
# |
May 26th 2017, 14:27 |
spriz |
unfortunately not |
# |
May 26th 2017, 14:27 |
spriz |
nope |
# |
May 26th 2017, 14:27 |
jeremyharris |
does laravel use phinx? |
# |
May 26th 2017, 14:26 |
spriz |
I have a laravel side-project where I do though :slightly_smiling_face: |
# |
May 26th 2017, 14:26 |
rudy1976s |
I ask this because I am used to create migrations under Yii2 and now I need to do the same with cake |
# |
May 26th 2017, 14:26 |
spriz |
we don't on my cake project @jeremyharris |
# |
May 26th 2017, 14:26 |
jeremyharris |
sprix do you use seeds yourself? I’ve got a question about them |
# |
May 26th 2017, 14:26 |
spriz |
@rudy1976s but you can just put raw SQL in the migrations and populate data by thta ;) |
# |
May 26th 2017, 14:26 |
spriz |
@rudy1976s - that sounds more like seeds :slightly_smiling_face: |
# |
May 26th 2017, 14:25 |
rudy1976s |
Hello , I am using migrations: is there a way to use migrations for populating data too ? or to do some other stuffs ? |
# |
May 26th 2017, 14:22 |
deco |
Thank you! |
# |
May 26th 2017, 14:22 |
jeremyharris |
cool, glad to help! |