Database problems after switch to Linux

Hello all,

I have worked through the book to the start of chapter 9 and I am in the process of shifting from a Windows environment to Linux (Mint 11). I have committed the project to SVN and checked it out. I made an export of the trackstar_dev database and have imported it to the Linux machine, apparently without problems. It’s all there according to phpMyAdmin anyway.

I can start the application and login successfully, BUT when I attempt to view any project (even as the user who created it) I receive an exception:


CDbCommand failed to execute the SQL statement: SQLSTATE[42S02]: Base table or view not found: 1146 Table 'trackstar_dev.AuthAssignment' doesn't exist. The SQL statement executed was: SELECT * FROM AuthAssignment WHERE userid=:userid 

I am not sure if something funny is going on here, like Linux being strict with capitalization where Windows is slack. The database trackstar_dev most certainly exists (I wouldn’t be able to log in if it didn’t) and the table authassignment (note all lower case) exists too.

Please note, this setup is working fine under Windows so I sure it is either a capitalization issue or a permissions one. If anyone has any ideas on how I might proceed, I’m all ears! Thanks!

I just tried to rename the database tables to what the app is expecting (capitalized) and it’s working now. If anyone has any thoughts (thinks this is NOT the right way to go about fixing this issue) then let me know please!

Yes, the problem is in the proper capitalization… your fix is OK…

Thanks for the input mdomba :)

How about if I want to use lowercase names?

Ok, I just used strtolower in the tableName method for each model.

add this


'assignmentTable'=>'authassignment'

, to config/main.php under authManager


'components'=>array(

		'user'=>array(

			...

		),

		

		'authManager'=>array(

			'class'=>'RDbAuthManager',

                        'assignmentTable'=>'authassignment',

                        'itemChildTable'=>'authitemchild',



Add this :


 'itemTable'=>'authitem', 

to config/main.php to the authManager componemt like this:




'authManager'=>array(

            'class'=>'CDbAuthManager',

            'connectionID'=>'db',

            'assignmentTable'=>'authassignment',

            'itemChildTable'=>'authitemchild',

            'itemTable'=>'authitem',

        ),