feat(work-report): add voice-first reporting flow
This commit is contained in:
@@ -156,6 +156,7 @@ FROM (
|
||||
UNION ALL SELECT 'aihr_memory_candidate'
|
||||
UNION ALL SELECT 'aihr_service_memory'
|
||||
UNION ALL SELECT 'aihr_service_memory_version'
|
||||
UNION ALL SELECT 'aihr_work_report'
|
||||
) required
|
||||
LEFT JOIN information_schema.tables actual
|
||||
ON actual.table_schema = DATABASE() AND actual.table_name = required.table_name
|
||||
@@ -166,7 +167,50 @@ REMOTE
|
||||
)" || fail "remote schema check failed: $remote_ssh:$remote_db"
|
||||
|
||||
[[ -z "$missing" ]] || fail "remote schema missing required tables: $(printf '%s' "$missing" | tr '\n' ', ' | sed 's/, $//')"
|
||||
echo "remote_schema=38/38 $remote_ssh:$remote_db"
|
||||
local missing_work_report_columns
|
||||
missing_work_report_columns="$(ssh -o BatchMode=yes -o ConnectTimeout=10 "$remote_ssh" bash -s -- "$remote_db" <<'REMOTE'
|
||||
set -euo pipefail
|
||||
db="$1"
|
||||
mysql --batch --skip-column-names --connect-timeout=5 "$db" <<'SQL'
|
||||
SELECT required.column_name
|
||||
FROM (
|
||||
SELECT 'request_key' AS column_name
|
||||
UNION ALL SELECT 'request_hash'
|
||||
) required
|
||||
LEFT JOIN information_schema.columns actual
|
||||
ON actual.table_schema = DATABASE()
|
||||
AND actual.table_name = 'aihr_work_report'
|
||||
AND actual.column_name = required.column_name
|
||||
WHERE actual.column_name IS NULL
|
||||
ORDER BY required.column_name;
|
||||
SQL
|
||||
REMOTE
|
||||
)" || fail "remote work-report schema check failed: $remote_ssh:$remote_db"
|
||||
|
||||
[[ -z "$missing_work_report_columns" ]] \
|
||||
|| fail "remote work-report schema missing required columns: $(printf '%s' "$missing_work_report_columns" | tr '\n' ', ' | sed 's/, $//')"
|
||||
local work_report_unique_index
|
||||
work_report_unique_index="$(ssh -o BatchMode=yes -o ConnectTimeout=10 "$remote_ssh" bash -s -- "$remote_db" <<'REMOTE'
|
||||
set -euo pipefail
|
||||
db="$1"
|
||||
mysql --batch --skip-column-names --connect-timeout=5 "$db" <<'SQL'
|
||||
SELECT CONCAT(
|
||||
MIN(non_unique), '|',
|
||||
COALESCE(GROUP_CONCAT(column_name ORDER BY seq_in_index), ''), '|',
|
||||
SUM(sub_part IS NOT NULL)
|
||||
)
|
||||
FROM information_schema.statistics
|
||||
WHERE table_schema = DATABASE()
|
||||
AND table_name = 'aihr_work_report'
|
||||
AND index_name = 'uk_aihr_work_report_request';
|
||||
SQL
|
||||
REMOTE
|
||||
)" || fail "remote work-report unique-index check failed: $remote_ssh:$remote_db"
|
||||
|
||||
[[ "$work_report_unique_index" = "0|tenant_id,submitter_user_id,request_key|0" ]] \
|
||||
|| fail "remote work-report unique index invalid: expected unique full columns tenant_id,submitter_user_id,request_key; got ${work_report_unique_index:-missing}"
|
||||
echo "remote_schema=39/39 $remote_ssh:$remote_db"
|
||||
echo "remote_work_report_idempotency=3/3 $remote_ssh:$remote_db"
|
||||
}
|
||||
|
||||
changed_files="$(git status --porcelain)"
|
||||
|
||||
Reference in New Issue
Block a user