Log message #4032943

# At Username Text
# May 26th 2017, 15:30 hmic you do not need to change them
# May 26th 2017, 15:30 hmic it gets them from the schema automatically
# May 26th 2017, 15:29 styks1987 ok, do you know where the default types are defined? I don’t know what type to use? I see examples for integer
# May 26th 2017, 15:26 hmic remember: use leftJoinWith ;-)
# May 26th 2017, 15:26 hmic it's not available if you use the 'conditions' key in a join definition
# May 26th 2017, 15:26 hmic its the second parameter to ->where()
# May 26th 2017, 15:24 styks1987 I don’t see that type int he docs
# May 26th 2017, 15:24 styks1987 hmic: how would I specify no value? I’d like to keep the array
# May 26th 2017, 15:23 styks1987 oh, but it made it a string… yea ok you are right
# May 26th 2017, 15:23 hmic easiest way: just don't do an associative array, but put them like: 'Bids.listing_id = OtherBids.listing_id', ...
# May 26th 2017, 15:23 styks1987 hmic: or is it because I had them in the wrong order? It appears that I am supposed to put the joining table first in conditions?
# May 26th 2017, 15:22 hmic you need to tell the orm that this is no data but identifiers
# May 26th 2017, 15:22 hmic so they get casted to the fitting datatype, thats int. so your strings will all be 0 in the query
# May 26th 2017, 15:22 hmic because you did not tell the orm that these are no values
# May 26th 2017, 15:21 hmic yeah
# May 26th 2017, 15:20 styks1987 http://paste.debian.net/943301/
# May 26th 2017, 15:20 styks1987 looks like something is up with the join. It is filling the conditions with 0
# May 26th 2017, 15:14 styks1987 hmic: I’m copying it from the ->sql() output, might try bin log next
# May 26th 2017, 15:11 hmic that does not make much sense if the generated sql is what you have shwon :-/
# May 26th 2017, 15:11 styks1987 in the orm
# 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