Yii2 migrations. Percentage sign and brackets in table name -


i browsed yii2-oauth2-server code on github , encountered interesting syntax in migration file. code in question looks this:

    $this->createtable('{{%oauth_clients}}', [         ...     ], $tableoptions); 

can explain {{%oauth_clients}} part? mean when table name enclosed in {{%..}}? official documentation on migrations says nothing , examples have "raw" table names this:

    $this->createtable('post_tag', [         ...     ]); 

i checked database , table created if there no brackets, name oauth_clients.

is used table prefix

from yii2 documentation on db connection:

if table name given {{%tablename}}, percentage character % replaced property value. example, {{%post}} becomes {{tbl_post}}.


Comments