1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-13 22:54:25 +01:00

Fixes for schema migrations and always set default country on clients

This commit is contained in:
David Bomba 2021-07-14 09:11:42 +10:00
parent 8d9950ebbd
commit fcbef56e46
2 changed files with 2 additions and 2 deletions

View File

@ -58,7 +58,7 @@ class ClientRepository extends BaseRepository
return $client;
}
if(!$client->id && (!array_key_exists('country_id', $data) || empty($data['country_id']))){
if(!$client->id && auth()->user() && auth()->user()->company() && (!array_key_exists('country_id', $data) || empty($data['country_id']))){
$data['country_id'] = auth()->user()->company()->settings->country_id;
}

View File

@ -1044,7 +1044,7 @@ CREATE TABLE `migrations` (
`migration` varchar(191) COLLATE utf8mb4_unicode_ci NOT NULL,
`batch` int(11) NOT NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci ROW_FORMAT=COMPRESSED KEY_BLOCK_SIZE=8;
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
/*!40101 SET character_set_client = @saved_cs_client */;
DROP TABLE IF EXISTS `password_resets`;
/*!40101 SET @saved_cs_client = @@character_set_client */;