修复供应商管理关联资料的镜像索引长度
This commit is contained in:
parent
a9819ce6d0
commit
4cd6013dc9
@ -221,7 +221,7 @@ return [
|
||||
'full_reconcile_hours' => 1,
|
||||
'columns' => ['id', 'ordernum', 'originname', 'title', 'tradebody', 'company',
|
||||
'eSignDocTemplateId', 'type', 'tradebtime', 'tradeetime', 'sendTime', 'completeTime', 'state', 'createUser'],
|
||||
'indexes' => [['tradebody(64)', 'company(64)']],
|
||||
'indexes' => [['tradebody', 'company']],
|
||||
],
|
||||
'jiansun.dbo.js_supplier_linkers' => [
|
||||
'source_key' => 'jiansun', 'schema' => 'dbo', 'object' => 'js_supplier_linkers',
|
||||
@ -229,7 +229,7 @@ return [
|
||||
'full_reconcile_hours' => 24,
|
||||
'columns' => ['Id', 'sourcefrom', 'scmname', 'linker', 'linkmobile', 'linkweixin',
|
||||
'linkjob', 'memo', 'local_created', 'local_updated'],
|
||||
'indexes' => [['scmname(64)', 'Id']],
|
||||
'indexes' => [['scmname', 'Id']],
|
||||
],
|
||||
'jiansun.dbo.js_supplier_payinfo' => [
|
||||
'source_key' => 'jiansun', 'schema' => 'dbo', 'object' => 'js_supplier_payinfo',
|
||||
@ -238,7 +238,7 @@ return [
|
||||
'columns' => ['Id', 'sourcefrom', 'scmname', 'enable', 'accounttype', 'account',
|
||||
'accountname', 'accountbank', 'memo', 'invoice', 'accountnature',
|
||||
'creator', 'updator', 'local_created', 'local_updated'],
|
||||
'indexes' => [['scmname(64)', 'Id']],
|
||||
'indexes' => [['scmname', 'Id']],
|
||||
],
|
||||
// 经营分析副本库:组织资料、订单、退款和聚水潭基础数据。
|
||||
'operations_replica.rpt.fys_companyInfo' => ['source_key' => 'operations_replica', 'schema' => 'rpt', 'object' => 'fys_companyInfo', 'target' => 'ops_fys_company_info', 'keys' => ['Id'], 'watermark' => 'updateTIme'],
|
||||
|
||||
@ -8,6 +8,7 @@ use Illuminate\Support\Facades\Schema;
|
||||
use Modules\EcommerceFinance\Repositories\GenericBusinessMirrorRepository;
|
||||
use Modules\EcommerceFinance\Repositories\SupplierManagementMirrorRepository;
|
||||
use Modules\EcommerceFinance\Services\BusinessMirrorDatasetRegistry;
|
||||
use Modules\EcommerceFinance\Services\BusinessMirrorSchemaManager;
|
||||
use Tests\TestCase;
|
||||
|
||||
class SupplierManagementMirrorRepositoryTest extends TestCase
|
||||
@ -49,6 +50,27 @@ class SupplierManagementMirrorRepositoryTest extends TestCase
|
||||
$this->assertSame([1, 2], array_map(fn ($row) => $row->Id, iterator_to_array($this->repository->exportRows($filters))));
|
||||
}
|
||||
|
||||
public function test_related_mirror_indexes_can_be_built_from_the_50_character_source_fields(): void
|
||||
{
|
||||
$registry = new BusinessMirrorDatasetRegistry();
|
||||
foreach (SupplierManagementMirrorRepository::RELATED as $key) {
|
||||
$dataset = $registry->get($key);
|
||||
foreach ($registry->columnSelection($key) as $position => $name) {
|
||||
DB::table('upstream_schema_columns')->insert([
|
||||
'source_key' => 'jiansun', 'schema_name' => 'dbo', 'object_name' => $dataset->sourceObject(),
|
||||
'object_type' => 'VIEW', 'column_name' => $name, 'ordinal_position' => $position + 1,
|
||||
'data_type' => strtolower($name) === 'id' ? 'int' : 'varchar', 'max_length' => 50,
|
||||
'is_nullable' => true, 'synchronized_at' => now(),
|
||||
'created_at' => now(), 'updated_at' => now(),
|
||||
]);
|
||||
}
|
||||
(new BusinessMirrorSchemaManager())->ensure($dataset);
|
||||
$indexes = collect(Schema::connection('business_mirror')->getIndexes($dataset->targetTable()))
|
||||
->pluck('columns')->all();
|
||||
foreach ($dataset->indexDefinitions() as $columns) $this->assertContains($columns, $indexes);
|
||||
}
|
||||
}
|
||||
|
||||
public function test_details_do_not_mix_suppliers_or_contract_signing_companies(): void
|
||||
{
|
||||
foreach (SupplierManagementMirrorRepository::RELATED as $key) $this->ready($key);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user