После того, как я установил многопользовательский пакет hyn и запустил php artisan tenancy:migrate
, я получаю сообщение об ошибке «базовая таблица не найдена». Команда должна мигрировать три миграции. Первое существо 2017_01_01_000003_tenancy_websites.php
. Вот содержание ...
<?php
class TenancyWebsites extends AbstractMigration
{
protected $system = true;
public function up()
{
Schema::create('websites', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('uuid');
$table->timestamps();
$table->softDeletes();
});
}
public function down()
{
Schema::dropIfExists('websites');
}
}
Тогда 2017_01_01_000005_tenancy_hostnames.php
. Вот содержание ...
<?php
class TenancyHostnames extends AbstractMigration
{
protected $system = true;
public function up()
{
Schema::create('hostnames', function (Blueprint $table) {
$table->bigIncrements('id');
$table->string('fqdn')->unique();
$table->string('redirect_to')->nullable();
$table->boolean('force_https')->default(false);
$table->timestamp('under_maintenance_since')->nullable();
$table->bigInteger('website_id')->unsigned()->nullable();
$table->timestamps();
$table->softDeletes();
$table->foreign('website_id')->references('id')->on('websites')->onDelete('set null');
});
}
public function down()
{
Schema::dropIfExists('hostnames');
}
}
Тогда 2017_01_01_000003_tenancy_hostnames.php
. Вот содержание ...
class TenancyWebsitesNeedsDbHost extends AbstractMigration
{
protected $system = true;
public function up()
{
Schema::table('websites', function (Blueprint $table) {
$table->string('managed_by_database_connection')
->nullable()
->comment('References the database connection key in your database.php');
});
}
public function down()
{
Schema::table('websites', function (Blueprint $table) {
$table->dropColumn('managed_by_database_connection');
});
}
}
Я выполнил все шаги в их документации. Что не так с кодом?