40 lines
1.3 KiB
PHP
40 lines
1.3 KiB
PHP
<?php
|
|
|
|
use A7kz\Platform\Models\UniModel;
|
|
use A7kz\Platform\Modules\Platform\Core\Facades\Core;
|
|
use A7kz\Platform\Modules\Platform\Segment\Facades\Segment;
|
|
use Carbon\Carbon;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\DB;
|
|
use Illuminate\Support\Facades\Schema;
|
|
use Illuminate\Support\Facades\Storage;
|
|
use \A7kz\Platform\Commands\InstallScript;
|
|
|
|
return new class extends \A7kz\Platform\Commands\InstallScript {
|
|
|
|
public function install($module_name, $module_version)
|
|
{
|
|
}
|
|
|
|
public function update($module_name, $module_version): void
|
|
{
|
|
$this->upgrade();
|
|
}
|
|
|
|
private function upgrade(): void
|
|
{
|
|
$segments = Segment::listActive();
|
|
foreach ($segments as $segment) {
|
|
if (!Schema::connection($segment->connector)->hasTable('pipi_auto_calendar')) {
|
|
Schema::connection($segment->connector)->create('pipi_auto_calendar', static function (Blueprint $table) {
|
|
$table->id();
|
|
$table->string('auto_id')->nullable()->comment('Автомобиль');
|
|
$table->date('date')->nullable()->comment('Дата');
|
|
$table->string('status')->nullable()->comment('Статус');
|
|
$table->timestamps();
|
|
});
|
|
}
|
|
}
|
|
}
|
|
};
|