nWidart/DbExporter

修正bug

boolw opened this issue · 2 comments

boolw commented

nwidart\db-exporter\src\Nwidart\DbExporter\DbExporter.php
文件:37行
'information_schema.columns' 修正为 DB::raw('information_schema.columns')

原因:DB::table('information_schema.columns') 会自动加上前缀,导致报错
例:SQLSTATE[42S02]: Base table or view not found: 1146 Table 'bool_bool_inform
ation_schema.columns' doesn't exist (SQL: select column_name as Field,
column_type as Type, is_nullable as Null, column_key as Key, c olumn_default as Default, extra as Extra, data_type as Data_Type
from bool_bool_information_schema.columns where table_schema = bool_
cms and table_name = bool_admins)

boolw commented

还有类似的:
50行:DB::table($table) 修正为 DB::table(DB::raw($table))

@boolw Thx! 刚好遇到自定义前缀问题。

更新:发现如果这样修改后,再使用 php artisan migrate 命令,会再增加一个前缀。比如:blog_blog_users。