Display console messages during the migration
This commit is contained in:
parent
3f48a3cf60
commit
a735b8aa2b
1 changed files with 4 additions and 0 deletions
|
@ -7,6 +7,7 @@
|
||||||
use Illuminate\Support\Facades\Schema;
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
use Illuminate\Database\Migrations\Migration;
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Symfony\Component\Console\Output\ConsoleOutput;
|
||||||
use MillionsMissingFrance\FreescoutRestrictedCustomers\Customer;
|
use MillionsMissingFrance\FreescoutRestrictedCustomers\Customer;
|
||||||
|
|
||||||
class AddMailboxIdColumnToCustomersTable extends Migration {
|
class AddMailboxIdColumnToCustomersTable extends Migration {
|
||||||
|
@ -31,10 +32,13 @@ class AddMailboxIdColumnToCustomersTable extends Migration {
|
||||||
->onDelete('cascade');
|
->onDelete('cascade');
|
||||||
});
|
});
|
||||||
// Link Customers to Mailboxes, through their Conversation information.
|
// Link Customers to Mailboxes, through their Conversation information.
|
||||||
|
$output = new ConsoleOutput();
|
||||||
|
$output->writeln('<info>Linking existing Customers to Mailboxes, it might take a couple minutes…</info>');
|
||||||
$customers = Customer::all();
|
$customers = Customer::all();
|
||||||
$customers->each(function ($customer) {
|
$customers->each(function ($customer) {
|
||||||
$customer->linkToMailboxThroughConversations();
|
$customer->linkToMailboxThroughConversations();
|
||||||
});
|
});
|
||||||
|
$output->writeln('<info>Linking existing Customers to Mailboxes done.</info>');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in a new issue