packServer/backend/database/migrations/20261018180000-add-has-ptz-to-cameras.js

24 lines
684 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 增加 has_ptz(是否带云台)
*
* 不是所有通道都挂云台(也有固定枪机),由用户在「编辑摄像头」里勾选;
* 预览页面只在勾选后显示云台方向盘(避免给固定机位发云台命令报“设备不支持”)。
*/
module.exports = {
async up(queryInterface, Sequelize) {
await queryInterface.addColumn('cameras', 'has_ptz', {
type: Sequelize.BOOLEAN,
allowNull: false,
defaultValue: false,
after: 'enabled',
comment: '是否支持云台(PTZ)',
});
},
async down(queryInterface) {
await queryInterface.removeColumn('cameras', 'has_ptz');
},
};