Fixed: Country is not required for sync

This commit is contained in:
philipp lang 2021-11-18 00:34:53 +01:00
parent 75a4817acb
commit ea1fbdcd72
2 changed files with 5 additions and 5 deletions

View File

@ -67,7 +67,7 @@ class InitializeMembers {
'gender_id' => optional(Gender::firstWhere('nami_id', $member->gender_id ?: -1))->id,
'confession_id' => optional(Confession::firstWhere('nami_id', $member->confession_id ?: -1))->id,
'region_id' => optional(Region::firstWhere('nami_id', $member->region_id ?: -1))->id,
'country_id' => Country::where('nami_id', $member->country_id)->firstOrFail()->id,
'country_id' => optional(Country::where('nami_id', $member->country_id)->first())->id,
'subscription_id' => $this->getSubscriptionId($member),
'nationality_id' => Nationality::where('nami_id', $member->nationality_id)->firstOrFail()->id,
'version' => $member->version,

View File

@ -1,9 +1,9 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Bill\BillKind;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateMembersTable extends Migration
{
@ -28,7 +28,7 @@ class CreateMembersTable extends Migration
$table->string('lastname');
$table->string('nickname')->nullable();
$table->foreignId('gender_id')->nullable()->constrained();
$table->foreignId('country_id')->constrained();
$table->foreignId('country_id')->nullable()->constrained();
$table->string('other_country')->nullable();
$table->foreignId('confession_id')->nullable()->constrained();
$table->date('birthday');