patrick_s
(Patrick)
September 16, 2015, 8:53pm
1
inside migration script, I try to get migrationTable name, programatically
Yii::$app->controller->migrationTable
but the value is quoted , i.e. {{%migrate}}
% means table prefix
how do I translate that into a real string name representing migration table?
Bushi
(Pedroguarimata)
September 16, 2015, 10:21pm
2
what for you need the table name ?
that string is the name of the migration table but using prefix syntax.
see quoting-table-and-column-names
Bushi
(Pedroguarimata)
September 16, 2015, 10:35pm
3
this way
\Yii::$app->db->schema->getRawTableName(Yii::$app->controller->migrationTable);
patrick_s
(Patrick)
September 18, 2015, 9:44pm
4
Thank you Bushi.
I have to alter every table (around 30) pragmatically(e.g. to attach access time-stamp field) , and I need to bypass Yii2 specific tables, such as migration and RBAC.