Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

修正bug #38

Open
boolw opened this issue Jun 21, 2016 · 2 comments
Open

修正bug #38

boolw opened this issue Jun 21, 2016 · 2 comments

Comments

@boolw
Copy link

boolw commented Jun 21, 2016

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
Copy link
Author

boolw commented Jun 21, 2016

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

@runbing
Copy link

runbing commented Aug 23, 2016

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

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants