Log message #4170288

# At Username Text
# Oct 4th 2018, 15:43 ricksaccous the composite key
# Oct 4th 2018, 15:43 ricksaccous of
# Oct 4th 2018, 15:43 ricksaccous so in this particular case you are making item_id a concatenation
# Oct 4th 2018, 15:43 ricksaccous i see
# Oct 4th 2018, 15:43 rudy1976s every model on my app has a hasMany relation with Attachments
# Oct 4th 2018, 15:42 rudy1976s yes
# Oct 4th 2018, 15:42 rudy1976s it's a typed table
# Oct 4th 2018, 15:42 ricksaccous based on model and plugin fields?
# Oct 4th 2018, 15:42 ricksaccous so you are grabbing the association based on conditions as well
# Oct 4th 2018, 15:42 rudy1976s yes
# Oct 4th 2018, 15:42 rudy1976s then there is model and plugin to type it
# Oct 4th 2018, 15:42 ricksaccous so item_id relates to many tables at once?
# Oct 4th 2018, 15:41 rudy1976s then hash,size etc
# Oct 4th 2018, 15:41 rudy1976s the attachments table has some rows : item id which is a varchar 255 where I normally store the associated foreign key
# Oct 4th 2018, 15:41 ricksaccous lol
# Oct 4th 2018, 15:41 ricksaccous that's why i want to see the rows
# Oct 4th 2018, 15:40 ricksaccous how does that even work then...
# Oct 4th 2018, 15:40 rudy1976s but that table is also used to store attachments for models which does not use CFK
# Oct 4th 2018, 15:39 ricksaccous you could split item_id into two fields
# Oct 4th 2018, 15:39 ricksaccous or
# Oct 4th 2018, 15:39 rudy1976s I cannot actually print row
# Oct 4th 2018, 15:39 angelxmoreno greeting bakers!
# Oct 4th 2018, 15:38 ricksaccous rather than two to one key
# Oct 4th 2018, 15:38 ricksaccous I think I'd recommend just making it so the relationship is more of a key to key
# Oct 4th 2018, 15:35 ricksaccous I'm not sure i can solve your problem, but i'm curious about it, lol
# Oct 4th 2018, 15:34 rudy1976s sure
# Oct 4th 2018, 15:34 ricksaccous can i see a sample row of both tables
# Oct 4th 2018, 15:34 rudy1976s I see that cake saves CFK using keys plus ";"
# Oct 4th 2018, 15:34 rudy1976s it should
# Oct 4th 2018, 15:32 ricksaccous is item_id a concat of code and category_id or something
# Oct 4th 2018, 15:32 rudy1976s code and category is are in the Products Group table and item_id on Attachments table
# Oct 4th 2018, 15:32 ricksaccous what two fields match in those tables
# Oct 4th 2018, 15:32 ricksaccous ??
# Oct 4th 2018, 15:31 ricksaccous but i'm saying, wouldn't the keys have to correspond
# Oct 4th 2018, 15:31 rudy1976s I have a single table used for attachments
# Oct 4th 2018, 15:30 ricksaccous what logic would you even use for that
# Oct 4th 2018, 15:30 ricksaccous how does code and category id correspond to foreignKey though, heh
# Oct 4th 2018, 15:29 rudy1976s snippet of the table
# Oct 4th 2018, 15:29 rudy1976s https://gist.github.com/rudy1976s/59edd5dbf8940975677d6823822a9fca
# Oct 4th 2018, 15:29 rudy1976s yes
# Oct 4th 2018, 15:29 ricksaccous @rudy1976s correct?