Closed hobbydev71 closed 2 years ago
protected $dataTableRelationships = [ "belongsTo" => [ 'user' => [ "model" => Customer::class, 'foreign_key' => 'user_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team' => [ "model" => Protocol::class, 'foreign_key' => 'team_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team_schedule' => [ "model" => ProtocolSchedule::class, 'foreign_key' => 'team_id', 'columns' => [ 'start_date' => [ 'orderable' => true, ], ], ], ], }
I tried above code ,but get error like this. message: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'team_id'
Protocol, ProtocolSchedule has the column team_id. How can I solve this issue?
protected $dataTableRelationships = [ "belongsTo" => [ 'user' => [ "model" => Customer::class, 'foreign_key' => 'user_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team' => [ "model" => Protocol::class, 'foreign_key' => 'team_id', 'columns' => [ 'name' => [ 'searchable' => true, 'orderable' => true, ], ], ], 'team_schedule' => [ "model" => ProtocolSchedule::class, 'foreign_key' => 'team_id', 'columns' => [ 'start_date' => [ 'orderable' => true, ], ], ], ], }
I tried above code ,but get error like this. message: SQLSTATE[42S21]: Column already exists: 1060 Duplicate column name 'team_id'
Protocol, ProtocolSchedule has the column team_id. How can I solve this issue?