thyseus / yii-user-management

a user management module collection for the yii framework
185 stars 122 forks source link

Table prefix support, ex: private $_tables = array( 'user' => '{{user}}', ... etc #114

Closed d3artagnan closed 11 years ago

d3artagnan commented 11 years ago

Can we support table prefix in YUM,

for example: private $_tables = array( 'user' => 'user', 'privacySetting' => 'privacysetting', 'translation' => 'translation', 'message' => 'message', 'usergroup' => 'usergroup', 'usergroupMessage' => 'usergroup_message', 'profile' => 'profile', 'profileComment' => 'profile_comment', 'profileVisit' => 'profile_visit', 'profileField' => 'profile_field', 'role' => 'role', 'userRole' => 'user_role', 'membership' => 'membership', 'payment' => 'payment', 'friendship' => 'friendship', 'permission' => 'permission', 'action' => 'action', );

when i use prefix in main config: 'db' => array( 'connectionString' => ... bla bla bla... 'tablePrefix' => 'frn_',

YUM throw exception: The table "profile" for active record class "YumProfile" cannot be found in the database.

fix: I replace 'user' => 'user', 'privacySetting' => 'privacysetting', 'translation' => 'translation', 'message' => 'message', 'usergroup' => 'usergroup', etc To 'user' => '{{user}}', 'privacySetting' => '{{privacysetting}}', 'translation' => '{{translation}}', 'message' => '{{message}}', 'usergroup' => '{{usergroup}}',

This works.

thyseus commented 11 years ago

fixed in recent commit, thanks for reporting