Okay, I changed the customer hasand belongstomany to this:
var $hasAndBelongsToMany = array(
'Service' => array(
'className' => 'Service',
'joinTable' => 'scheduler_customers_services',
'foreignKey' => 'customer_id',
'associatedForeignKey' => 'service_id'
)
);
Not real sure why it was working like the one above before but it was,
the only thing I have done was change the table names to make them
more distinct (added scheduler to begining of name). So now, I am no
longer getting the error but the scheduler_customers_services never
gets updated with customer id and service ids. What is the best way
to update tables like this?
On Oct 16, 3:21 pm, MDB <[EMAIL PROTECTED]> wrote:
> Hello all, I have 3 tables:
>
> scheduler_customers_services (customer_id int, service_id int)
> scheduler_services (id int)
> scheduler_customers (id int)
>
> My models looks something like this:
>
> class Service extends AppModel
> {
> var $name = 'Service';
> var $useTable = 'scheduler_services';
> var $primaryKey = 'id';
>
> var $hasAndBelongsToMany = array(
> 'Customer' => array(
> 'className' => 'Customer',
> 'joinTable' => 'scheduler_customers_services',
> 'foreignKey' => 'service_id',
> 'associatedForeignKey' => 'customer_id'
> )
> );
>
> }
>
> ?>
>
> class Customer extends AppModel
> {
> var $name = 'Customer';
> var $useTable = 'scheduler_customers';
> var $primaryKey = 'id';
>
> var $hasAndBelongsToMany = array(
> 'Service' => array(
> 'className' => 'Service',
> 'joinTable' => 'scheduler_customers_services',
> 'foreignKey' => 'customer_id',
> 'associatedForeignKey' => 'service_id',
> 'joinTable' => null,
> 'foreignKey' => null,
> 'associatedForeignKey' => null,
> 'conditions' => null,
> 'fields' => null,
> 'order' => null,
> 'limit' => null,
> 'uniq' => true,
> 'offset' => null,
> 'fnderQuery' => null,
> 'deleteQuery' => null,
> 'insertQuery' => null
> )
> );}
>
> ?>
>
> I am getting the following error and can not seem to figure out why?
>
> Error: Database table scheduler_customers_scheduler_services for model
> SchedulerCustomersSchedulerService was not found.
>
> I am new to cakephp and took over this project from someone else so if
> anyone can help, I would greatly appreciate it.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---