reliese / laravel

Reliese Laravel Model Generator
MIT License
1.49k stars 316 forks source link

Get error when generate models #26

Open lttin0912 opened 7 years ago

lttin0912 commented 7 years ago

I used "ignasbernotas/laravel-model-generator" package before and I see "Please use reliese/laravel package instead." Now, I use Laravel 5.4 and have an exists database in MySQL. I want to generate models. When I run "php artisan code:models" I receive the error: [Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters
[PDOException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters
Please help me. Thanks.

CristianLlanos commented 7 years ago

This is weird. Do you happen to know how to replicate this. I've tried with my own database and have no problems.

CristianLlanos commented 7 years ago

Do you mind sharing which version of mysql you are using? 🤔

lttin0912 commented 7 years ago

Yeah, I use laravel version 5.4 and PHP version 5.6.36. "ignasbernotas/laravel-model-generator" package is OK. I'll try one more time.

lttin0912 commented 7 years ago

As it would seem, when I run command: "php artisan code:models", it did not use database from .env, it used another database (that is "furnicom"). Do I need to config my database? If yes, please help me config. Thank you!

[Illuminate\Database\QueryException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters (SQL: SHOW FULL COLUMNS FROM furnicom.?:option)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters
[PDOException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters

CristianLlanos commented 7 years ago

Do you have a table name ?:option? 🤔 BTW, you can specify the database schema you are interested in by telling it through the option --schema, like this: php artisan code:models --schema=my_database. When you don't specify the schema, it uses the default from your database.php file which should be filled by the .env variables.

lttin0912 commented 7 years ago

Yes, I config my database in .env and ?:option? is in another database (furnicom). It's very strange, because I config like that but I use "ignasbernotas/laravel-model-generator" package is OK. I use MAC OSX not Windows OS

php artisan code:models --schema=test [Illuminate\Database\QueryException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters (SQL: SHOW FULL COLUMNS FROM furnicom.?:option)
[Doctrine\DBAL\Driver\PDOException]
SQLSTATE[HY093]: Invalid parameter number: mixed named and positional param
eters