I setup multiple database connection via config/database.php and then tried to run
php artisan migrate:install --database=local
but then i get this error
[Illuminate\Database\QueryException]
SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' (SQL: create table `` (`migration` varchar(255) not null, `batch` int not null) default character set utf8 collate utf8_unicode_ci)
weird thing is when I remove the config/database.php, the migration went on successfully.
Adding 'migrations' => 'migrations' to your database config array in config/database.php to declare the migrations table will solve this issue.
Full example
<?php
return [
'default' => 'external',
'migrations' => 'migrations',
'connections' => [
// your connections
],
];
hi @hiddeco ,
thanks a lot. this does solve my issue.
anyways, can you please elaborate what the 'migrations' -> 'migrations' does to the configuration?
thanks
@matthewsuan: the migrations' => 'migrations' will simply set the table used for storing migration history (link).
What does your config/database.php look like and what is the error you are getting?
Most helpful comment
Adding
'migrations' => 'migrations'to your database config array inconfig/database.phpto declare the migrations table will solve this issue.Full example