Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No table name set on execute migration in Lumen

Tags:

php

laravel

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.

like image 594
henriale Avatar asked Oct 01 '15 04:10

henriale


People also ask

How do I change the table name in Migration?

To change a table name, you can do this: Schema::rename($currentTableName, $newTableName); You can use the drop or dropIfExists methods to remove an existing table: Schema::drop('users'); Schema::dropIfExists('users');

How do I rename a table column in laravel Migration?

To rename a column, you may use the renameColumn method on the Schema builder. Before renaming a column, be sure to add the doctrine/dbal dependency to your composer. json file: Schema::table('users', function (Blueprint $table) { $table->renameColumn('from', 'to'); });

What is Migration table?

Migration tables are files that are created by an administrator. They are used to implement the advanced capabilities of Group Policy object (GPO) import and copy operations. A migration table can contain information about references to security principals, to Universal Naming Convention (UNC) paths, or to both.


1 Answers

I found the solution myself!

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

'migrations' => 'migrations',

like image 103
henriale Avatar answered Oct 04 '22 04:10

henriale