Lumen-framework: Database Migrations for Multiple Database Connection Error

Created on 18 Sep 2015  路  3Comments  路  Source: laravel/lumen-framework

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.

Most helpful comment

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
    ],
];

All 3 comments

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?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dunice picture dunice  路  3Comments

gfazioli picture gfazioli  路  5Comments

megawubs picture megawubs  路  5Comments

jairobjunior picture jairobjunior  路  4Comments

patrikengborg picture patrikengborg  路  3Comments