- DB 테이블명 변경 마이그레이션 스크립트 추가 (migrate_v5_rename_remote.js) - Backend (server.js): 쿼리 및 매핑 로직을 asset_remote 및 remotes 속성으로 업데이트 - Frontend (HWModal.ts): 폼 필드와 데이터 바인딩을 remotes로 일괄 수정 - 유틸리티 스크립트의 레퍼런스 일괄 업데이트
30 lines
876 B
JavaScript
30 lines
876 B
JavaScript
import mysql from 'mysql2/promise';
|
|
import dotenv from 'dotenv';
|
|
|
|
dotenv.config();
|
|
|
|
const { DB_HOST, DB_USER, DB_PASS, DB_NAME, DB_PORT } = process.env;
|
|
|
|
async function checkRemote() {
|
|
const connection = await mysql.createConnection({
|
|
host: DB_HOST,
|
|
user: DB_USER,
|
|
password: DB_PASS,
|
|
database: DB_NAME,
|
|
port: parseInt(DB_PORT || '3306')
|
|
});
|
|
|
|
console.log('--- Checking asset_remote table ---');
|
|
|
|
const [columns] = await connection.query('DESCRIBE asset_remote');
|
|
const cols = columns.map(c => c.Field);
|
|
console.log('Columns in asset_remote:', cols.join(', '));
|
|
|
|
const [count] = await connection.query('SELECT COUNT(*) as count FROM asset_remote WHERE remote_tool IS NOT NULL OR remote_id IS NOT NULL');
|
|
console.log(`Rows with remote info (tool or id): ${count[0].count}`);
|
|
|
|
await connection.end();
|
|
}
|
|
|
|
checkRemote().catch(console.error);
|