Solution: Table ‘DATEBASE_NAME.AuthAssignment’ doesn’t exist

Table 'DATEBASE_NAME.AuthAssignment' doesn't exist
Standard

Problem:
When you upload your Yii website to a Linux server, and you are using yii-rights module you may encounter AuthAssignment table doesn’t exist message.

Table 'DATEBASE_NAME.AuthAssignment' doesn't exist

This is because your tables are in lowercase but in code they are being referred with different capitalization, Linux is case senstive so it treats authassignment and AuthAssignment differently.

Solution:
In your root/protected/config/main.php specify table names as they are in your database.

'components'=>array(
    'authManager'=>array( 
            'defaultRoles'=>array('guest'),
            'class'=>'RDbAuthManager',
            'assignmentTable'=>'authassignment',
            'itemTable'=>'authitem',
            'rightsTable'=>'rights',
            'itemChildTable'=>'authitemchild',
    ), 
Advertisements

3 thoughts on “Solution: Table ‘DATEBASE_NAME.AuthAssignment’ doesn’t exist

  1. rashmani

    Thanks! I’m running a test server on Windows with WAMP but your fix worked for me as well, ’cause of the apache server involved!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: