packServer/backend/database/migrations/20261018150000-add-channel-name-to-cameras.js

24 lines
663 B
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use strict';
/**
* cameras 增加 channel_name(设备上的通道名,来自 ISAPI)
*
* 与 name 的区别:
* name = 业务别名(用户可改,重拉通道不覆盖)
* channel_name = 设备上的原始通道名(每次拉取会刷新)
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('cameras', 'channel_name', {
type: Sequelize.STRING(64),
allowNull: true,
after: 'name',
comment: '设备通道名(ISAPI,拉取通道时刷新)',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('cameras', 'channel_name');
},
};