Closed bobonov closed 8 years ago
No the migration script uses the yii migration standard of using table prefixes in %
format which basically prepends the table prefix as set in your database component configuration. Normally the table prefix is set to tbl_
by default and hence the migration script should auto create tbl_dynagrid
and tbl_dynagrid_dtl
.
Yii2 default for table prefix is not anymore tbl_ since mid 2014, now default is empty string https://github.com/yiisoft/yii2/issues/2911 Anyway fixing it is a minor issue, is just that most of the people do not use tablePrefix params and in a standard yii2 installation dynagrid do not work out of the box.
I am noting an update in docs for mentioning this.
I saw no mention in the docs regarding the tbl prefix issue. I also saw no mention in the docs on either how to automatically trigger the migration script or manually run it from the command line. I had to manually run: yii migrate --migrationPath=@vendor/kartik-v/yii2-dynagrid/migrations
Then add:
'dbSettings' => [
'tableName' => 'dynagrid',
],
'dbSettingsDtl' => [
'tableName' => 'dynagrid_dtl',
],
to the dynagrid config.
It would be nice for the setup for using migrations were to be clearly explained in the docs.
Default name are tbl_dynagrid and tbl_dynagrid_dtl but migration script uses dynagrid and dynagrid_dtl. Change the default or the migration script so they match.