henriale
henriale

Reputation: 1042

No table name set on execute migration in Lumen

I'm facing this error when attempting to run the migration in Lumen Framework:

$ php artisan migrate:install

 [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)     

  [PDOException]                                                                   
  SQLSTATE[42000]: Syntax error or access violation: 1103 Incorrect table name '' 

And now I have no idea what's going on.

Note that the table that is not being created is the one which controls the migrations at all.

Upvotes: 16

Views: 4876

Answers (2)

lorajc
lorajc

Reputation: 106

<?php
return [

    'default' => 'external',
    'migrations' => 'migrations',
    'connections' => [
        // your connections
    ],
];

Upvotes: 6

henriale
henriale

Reputation: 1042

I found the solution myself!

Just add the name of the table on database config array and it's done!

'migrations' => 'migrations',

Upvotes: 49

Related Questions