kartik-v / yii2-dynagrid

Turbo charge the Yii 2 GridView with personalized columns, page size, and themes.
http://demos.krajee.com/dynagrid
Other
74 stars 66 forks source link

default tables name differ from the one used in migration script #106

Closed bobonov closed 8 years ago

bobonov commented 8 years ago

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.

kartik-v commented 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.

bobonov commented 8 years ago

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.

kartik-v commented 8 years ago

I am noting an update in docs for mentioning this.

maz0717 commented 8 years ago

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.