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.
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');
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'); });
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.
I found the solution myself!
Just add the name of the table on database config array and it's done!
'migrations' => 'migrations',
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With