Looks like one of your migrations holds an error...
Sep 16, 2015
6
Level 19
Database Migrations in Lumen with Multiple Database Connections
So i setup multiple database connections in config/database.php:
return [
'default' => 'trd_admin',
'connections' => [
'trd_admin' => [
'driver' => env('DB_CONNECTION'),
'host' => env('DB_HOST'),
'port' => env('DB_PORT'),
'database' => env('DB_DATABASE'),
'username' => env('DB_USERNAME'),
'password' => env('DB_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false
],
'local' => [
'driver' => env('LOCAL_CONNECTION'),
'host' => env('LOCAL_HOST'),
'port' => env('LOCAL_PORT'),
'database' => env('LOCAL_DATABASE'),
'username' => env('LOCAL_USERNAME'),
'password' => env('LOCAL_PASSWORD'),
'charset' => 'utf8',
'collation' => 'utf8_unicode_ci',
'prefix' => '',
'strict' => false
]
]
];
and when I run:
php artisan migrate:install --database=local
it gives me this errors:
[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 ''
Thanks for your reply.
Level 3
If anyone has the same problem like I just did, here is a valid solution :
https://github.com/laravel/lumen-framework/issues/248
You need to declare the migration entry is the database config
<?php
return [
'default' => 'external',
'migrations' => 'migrations',
'connections' => [
// your connections
],
];
1 like
Please or to participate in this conversation.