Open jozefrebjak opened 1 year ago
I have a table orders.
orders
There is two columns disponent_id & salesman_id.
disponent_id
salesman_id
Both have foreign key to the users table id. If I don't overwrite a scheme, then it's used last one so only user paired to the salesman_id.
users
id
user
So I tried to overwrite schema like in https://github.com/tattersoftware/codeigniter4-schemas/issues/41. Now my relation to the users table looks like:
[users] => Tatter\Schemas\Structures\Relation Object ( [table] => users [type] => belongsTo [singleton] => [pivots] => Array ( [0] => Array ( [0] => orders [1] => salesman_id [2] => users [3] => id ) [1] => Array ( [0] => orders [1] => disponent_id [2] => users [3] => id ) ) )
I think this is a bad design, but I need to pair two users from different groups because of internal settlement.
Thanks.
This is currently a limitation of the structure, because it is based on table names. I believe there was a PR somewhere to allow aliases, which might provide a workaround.
I have a table
orders
.There is two columns
disponent_id
&salesman_id
.Both have foreign key to the
users
tableid
. If I don't overwrite a scheme, then it's used last one so onlyuser
paired to thesalesman_id
.So I tried to overwrite schema like in https://github.com/tattersoftware/codeigniter4-schemas/issues/41. Now my relation to the
users
table looks like:I think this is a bad design, but I need to pair two users from different groups because of internal settlement.
Thanks.