schema->hasTable('role_users')) { $this->schema->create('role_users', function (Blueprint $table) { $table->integer('user_id')->unsigned(); $table->integer('role_id')->unsigned(); $table->timestamps(); $table->engine = 'InnoDB'; $table->collation = 'utf8_unicode_ci'; $table->charset = 'utf8'; $table->primary(['user_id', 'role_id']); //$table->foreign('user_id')->references('id')->on('users'); //$table->foreign('role_id')->references('id')->on('roles'); $table->index('user_id'); $table->index('role_id'); }); } } /** * {@inheritDoc} */ public function down() { $this->schema->drop('role_users'); } }