diff --git a/framework/yii/caching/DbCache.php b/framework/yii/caching/DbCache.php index cca2c55..76e2341 100644 --- a/framework/yii/caching/DbCache.php +++ b/framework/yii/caching/DbCache.php @@ -63,7 +63,7 @@ class DbCache extends Cache * When using DbCache in a production server, we recommend you create a DB index for the 'expire' * column in the cache table to improve the performance. */ - public $cacheTable = 'tbl_cache'; + public $cacheTable = '{{%cache}}'; /** * @var integer the probability (parts per million) that garbage collection (GC) should be performed * when storing a piece of data in the cache. Defaults to 100, meaning 0.01% chance. diff --git a/framework/yii/console/controllers/MigrateController.php b/framework/yii/console/controllers/MigrateController.php index 5651b9c..5730bbd 100644 --- a/framework/yii/console/controllers/MigrateController.php +++ b/framework/yii/console/controllers/MigrateController.php @@ -73,7 +73,7 @@ class MigrateController extends Controller /** * @var string the name of the table for keeping applied migration information. */ - public $migrationTable = 'tbl_migration'; + public $migrationTable = '{{%migration}}'; /** * @var string the template file for generating new migrations. * This can be either a path alias (e.g. "@app/migrations/template.php") diff --git a/framework/yii/db/ActiveRecord.php b/framework/yii/db/ActiveRecord.php index cc67224..28454b6 100644 --- a/framework/yii/db/ActiveRecord.php +++ b/framework/yii/db/ActiveRecord.php @@ -177,13 +177,14 @@ class ActiveRecord extends BaseActiveRecord /** * Declares the name of the database table associated with this AR class. * By default this method returns the class name as the table name by calling [[Inflector::camel2id()]] - * with prefix 'tbl_'. For example, 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes - * 'tbl_order_item'. You may override this method if the table is not named after this convention. + * with prefix [[DbConnection::tablePrefix]]. For example if [[DbConnection::tablePrefix]] is 'tbl_', + * 'Customer' becomes 'tbl_customer', and 'OrderItem' becomes 'tbl_order_item'. You may override this method + * if the table is not named after this convention. * @return string the table name */ public static function tableName() { - return 'tbl_' . Inflector::camel2id(StringHelper::basename(get_called_class()), '_'); + return '{{%' . Inflector::camel2id(StringHelper::basename(get_called_class()), '_') . '}}'; } /** diff --git a/framework/yii/db/Connection.php b/framework/yii/db/Connection.php index 4a8571e..9637087 100644 --- a/framework/yii/db/Connection.php +++ b/framework/yii/db/Connection.php @@ -219,10 +219,9 @@ class Connection extends Component /** * @var string the common prefix or suffix for table names. If a table name is given * as `{{%TableName}}`, then the percentage character `%` will be replaced with this - * property value. For example, `{{%post}}` becomes `{{tbl_post}}` if this property is - * set as `"tbl_"`. + * property value. For example, `{{%post}}` becomes `{{tbl_post}}`. */ - public $tablePrefix; + public $tablePrefix = 'tbl_'; /** * @var array mapping between PDO driver names and [[Schema]] classes. * The keys of the array are PDO driver names while the values the corresponding diff --git a/framework/yii/i18n/DbMessageSource.php b/framework/yii/i18n/DbMessageSource.php index b660a86..9d43727 100644 --- a/framework/yii/i18n/DbMessageSource.php +++ b/framework/yii/i18n/DbMessageSource.php @@ -68,11 +68,11 @@ class DbMessageSource extends MessageSource /** * @var string the name of the source message table. */ - public $sourceMessageTable = 'tbl_source_message'; + public $sourceMessageTable = '{{%source_message}}'; /** * @var string the name of the translated message table. */ - public $messageTable = 'tbl_message'; + public $messageTable = '{{%message}}'; /** * @var integer the time in seconds that the messages can remain valid in cache. * Use 0 to indicate that the cached data will never expire. diff --git a/framework/yii/log/DbTarget.php b/framework/yii/log/DbTarget.php index b649e9e..59eedc6 100644 --- a/framework/yii/log/DbTarget.php +++ b/framework/yii/log/DbTarget.php @@ -52,7 +52,7 @@ class DbTarget extends Target * of some queries about message levels and categories. Depending on your actual needs, you may * want to create additional indexes (e.g. index on `log_time`). */ - public $logTable = 'tbl_log'; + public $logTable = '{{%log}}'; /** * Initializes the DbTarget component. diff --git a/framework/yii/rbac/DbManager.php b/framework/yii/rbac/DbManager.php index e9e1730..2e47e50 100644 --- a/framework/yii/rbac/DbManager.php +++ b/framework/yii/rbac/DbManager.php @@ -41,15 +41,15 @@ class DbManager extends Manager /** * @var string the name of the table storing authorization items. Defaults to 'tbl_auth_item'. */ - public $itemTable = 'tbl_auth_item'; + public $itemTable = '{{%auth_item}}'; /** * @var string the name of the table storing authorization item hierarchy. Defaults to 'tbl_auth_item_child'. */ - public $itemChildTable = 'tbl_auth_item_child'; + public $itemChildTable = '{{%auth_item_child}'; /** * @var string the name of the table storing authorization item assignments. Defaults to 'tbl_auth_assignment'. */ - public $assignmentTable = 'tbl_auth_assignment'; + public $assignmentTable = '{{%auth_assignment}}'; private $_usingSqlite; diff --git a/framework/yii/web/DbSession.php b/framework/yii/web/DbSession.php index 48878b4..2b0b0e7 100644 --- a/framework/yii/web/DbSession.php +++ b/framework/yii/web/DbSession.php @@ -65,7 +65,7 @@ class DbSession extends Session * When using DbSession in a production server, we recommend you create a DB index for the 'expire' * column in the session table to improve the performance. */ - public $sessionTable = 'tbl_session'; + public $sessionTable = '{{%session}}'; /** * Initializes the DbSession component.