Initial commit: 宁夏智慧养殖监管平台
This commit is contained in:
19
backend/check-sensor-table.js
Normal file
19
backend/check-sensor-table.js
Normal file
@@ -0,0 +1,19 @@
|
||||
const { sequelize } = require('./config/database-simple');
|
||||
|
||||
async function checkSensorTable() {
|
||||
try {
|
||||
await sequelize.authenticate();
|
||||
console.log('数据库连接成功');
|
||||
|
||||
const [results] = await sequelize.query('SHOW COLUMNS FROM sensor_data');
|
||||
console.log('sensor_data表结构:');
|
||||
console.table(results);
|
||||
|
||||
} catch (error) {
|
||||
console.error('查询失败:', error.message);
|
||||
} finally {
|
||||
await sequelize.close();
|
||||
}
|
||||
}
|
||||
|
||||
checkSensorTable();
|
||||
Reference in New Issue
Block a user