7 lines
1.3 KiB
PHP
7 lines
1.3 KiB
PHP
<?php
|
|
$book='8085';require __DIR__.'/sgf-single-bootstrap.php';
|
|
$previous=json_decode(file_get_contents($s['root'].'/single-integration/20261111-073116-5f71ef3d/statements-installation.json'),true);$qualified=array_merge($previous['identical_original_tables'],['host.rm_meta','host.rm_versions','host.rm_commands','host.hr_qa_profiles','host.users','host.company_memberships','host.sgf_presentation_profiles']);$before=[];$order=fn($table)=>in_array($table,['sr_outbox','sr_deliveries'],true)?'event_id':(in_array($table,['sc_catalogue_meta','pd_due_meta','fo_meta','fs_meta','rm_meta'],true)?'policy':(in_array($table,['hr_qa_profiles','sgf_presentation_profiles'],true)?'profile_key':(in_array($table,['fs_results','fs_result_lines'],true)?'snapshot_key':($table==='company_memberships'?'user_id':'id'))));foreach($qualified as$key){[$name,$table]=explode('.',$key);$db=$name==='host'?$host:$native;$before[$name][$table]=$db->table($table)->orderBy($order($table))->when($table==='fs_result_lines',fn($q)=>$q->orderBy('account_id'))->get()->toJson();}$binding=hash_file('sha256',$s['root'].'/binding.json');file_put_contents($work.'/preservation-private.json',json_encode($before));
|
|
|
|
file_put_contents($s['root'].'/hr-personnel-backup-pointer.json',json_encode(['root'=>$work]));echo json_encode(['passed'=>true,'backup'=>$work,'database_writes'=>0]).PHP_EOL;
|
|
|