diff --git a/app/Http/Controllers/Sync1cApiController.php b/app/Http/Controllers/Sync1cApiController.php index 37ae42c..ef2e99d 100644 --- a/app/Http/Controllers/Sync1cApiController.php +++ b/app/Http/Controllers/Sync1cApiController.php @@ -122,6 +122,7 @@ class Sync1cApiController extends Controller 'code' => $value['Код'], ], [ + 'guid' => $value['СсылкаGUID'], 'is_group' => (bool)$value['ЭтоГруппа'], 'name' => $value['Наименование'], 'comments' => $value['Комментарий'], @@ -185,6 +186,7 @@ class Sync1cApiController extends Controller 'code' => $value['Код'], ], [ + 'guid' => $value['СсылкаGUID'], 'is_group' => (bool)$value['ЭтоГруппа'], 'name' => $value['Наименование'], 'comments' => $value['Комментарий'], diff --git a/modules/owner_contracts/script.php b/modules/owner_contracts/script.php index 6025864..d86fb89 100644 --- a/modules/owner_contracts/script.php +++ b/modules/owner_contracts/script.php @@ -48,6 +48,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript { $table->foreign('parent_id')->references('id')->on('pipi_owner_contracts'); }); } + + if (!Schema::connection($segment->connector)->hasColumn('pipi_owner_contracts', 'guid')) { + Schema::connection($segment->connector)->table('pipi_owner_contracts', static function (Blueprint $table) { + $table->string('guid')->unique()->nullable(); + }); + } } } diff --git a/modules/owners/script.php b/modules/owners/script.php index 01095de..12c004c 100644 --- a/modules/owners/script.php +++ b/modules/owners/script.php @@ -55,6 +55,12 @@ return new class extends \A7kz\Platform\Commands\InstallScript { $table->foreign('user_id')->references('id')->on('core_users'); }); } + + if (!Schema::connection($segment->connector)->hasColumn('pipi_owners', 'guid')) { + Schema::connection($segment->connector)->table('pipi_owners', static function (Blueprint $table) { + $table->string('guid')->unique()->nullable(); + }); + } } }