refactor: replace custom CRM with Monica fork
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
Some checks failed
Build & Push Monica Image to Gitea Registry / build-and-push (push) Failing after 9s
This commit is contained in:
28
database/migrations/2018_04_10_222515_migrate-modules.php
Normal file
28
database/migrations/2018_04_10_222515_migrate-modules.php
Normal file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
|
||||
use App\Models\Account\Account;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use App\Services\Auth\Population\PopulateModulesTable;
|
||||
|
||||
class MigrateModules extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Account::chunk(200, function ($accounts) {
|
||||
foreach ($accounts as $account) {
|
||||
app(PopulateModulesTable::class)->execute([
|
||||
'account_id' => $account->id,
|
||||
'migrate_existing_data' => false,
|
||||
]);
|
||||
}
|
||||
});
|
||||
|
||||
DB::table('default_contact_modules')->update(['migrated' => 1]);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user