No one is ever going to sell me on table prefixes lol, I dislike them immensely. Sometimes I think it’s like the old tab vs space debate.
Because using a table prefix is like saying: this data, it’s not like the other data. If this is the case why isn’t it in another database?
------ End Rant —
Anyway, technically I think it’s probably fine, just as long as you are aware of the limitations. The really annoying thing is any case where you are forced to write a custom query, you are going to need to do
$sql = "select * from {$tablePrefix}users";
Or as a placeholder replaced by CDbExpression or whatever, hardly the worst thing I’ve ever seen.
Anything not done in the action however is unaffected, so if you are using database driven sessions or whatever else, it’s going to happen in the non-prefixed tables. I can’t recall if filters get called before ‘beforeControllerAction’ or after, so if you use filters with a DB component, keep that in mind.
my intention is trying to make each module as independent as possible while at the same time nicely tied up with other module, table prefix groups up your module tables; so i can drop the module from app to app a lot easily.
it seems even though yii provides AR, the magnet to use pure sql script seems pretty strong, however, in my opinion, if you have a script with 100 joins. there must be something wrong or some simple solution of table structure is there.