Php Laravel迁移到db_{tables}?
有没有一种方法可以迁移,在表名之前迁移Php Laravel迁移到db_{tables}?,php,laravel,migration,migrate,Php,Laravel,Migration,Migrate,有没有一种方法可以迁移,在表名之前迁移 例如,我得到了名为roles和users的表。我希望它迁移到db_角色和db_用户。有办法做到这一点吗?因此,在Laravel代码库中,您可以看到Lightning\Database\Schema\Blueprint类接受数据库前缀作为其最终参数。这允许您向表名添加前缀 /** * Create a new schema blueprint. * * @param string $table * @param \Closure|null $
例如,我得到了名为roles和users的表。我希望它迁移到db_角色和db_用户。有办法做到这一点吗?因此,在Laravel代码库中,您可以看到
Lightning\Database\Schema\Blueprint
类接受数据库前缀作为其最终参数。这允许您向表名添加前缀
/**
* Create a new schema blueprint.
*
* @param string $table
* @param \Closure|null $callback
* @param string $prefix
* @return void
*/
public function __construct($table, Closure $callback = null, $prefix = '')
{
$this->table = $table;
$this->prefix = $prefix;
if (! is_null($callback)) {
$callback($this);
}
}
我并没有实际实现这一点,但从理论上讲,这是您可以实现的方法。是否要重命名表?请参阅