Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/228.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/mysql/60.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php Laravel架构生成器在特定连接上放置表_Php_Mysql_Laravel 4 - Fatal编程技术网

Php Laravel架构生成器在特定连接上放置表

Php Laravel架构生成器在特定连接上放置表,php,mysql,laravel-4,Php,Mysql,Laravel 4,我使用Laravel的schema builder创建了一个users表。以下是迁移: class CreateUsersTable extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::connectio

我使用Laravel的schema builder创建了一个
users
表。以下是迁移:

class CreateUsersTable extends Migration {

        /**
         * Run the migrations.
         *
         * @return void
         */
        public function up()
        {
                Schema::connection('mysql-internal')->create('users', function(Blueprint $table)
                {
                        $table->increments('id');
                        $table->string('username');
                        $table->string('password');
                        $table->timestamps();
                });
        }

        /**
         * Reverse the migrations.
         *
         * @return void
         */
        public function down()
        {
                Schema::connection('mysql-internal')->drop('users');
        }

}
运行此迁移之后,我使用
php artisan migrate:rollback
将其回滚。但是,看起来
down
方法不尊重我的
连接。
users
表是从我默认的mysql数据库中删除的,而不是我指定的
mysql internal


我做错什么了吗?我使用的是Laravel 4.2.17。

看起来以前有一次迁移使用了相同的类名
CreateUsersTable
。我猜当我发出
rollback
命令时,它找到了该类的第一个实例,并运行了它的
down()
方法,该方法不包含
connection
参数。看起来以前有一次迁移使用了相同的类名
CreateUsersTable
。我猜当我发出
rollback
命令时,它找到了该类的第一个实例,并运行了它的
down()
方法,该方法不包含
connection
参数。