更新dbschema

This commit is contained in:
b110212000 2021-07-08 19:40:01 +08:00
parent 606801d3ac
commit 4c51608c99
2 changed files with 28 additions and 4 deletions

View File

@ -1024,8 +1024,22 @@ COMMENT='各電站每月日照度的平均值'
COLLATE='utf8mb4_unicode_ci'
ENGINE=InnoDB
;
-- 子DB逆變器新增欄位 20210708
ALTER TABLE `inverter`
ADD COLUMN `Enabled` tinyint(4) DEFAULT '0' COMMENT '是否啟用0:未啟用 1:啟用' AFTER `Deleted`,
ADD COLUMN `Status` tinyint(4) DEFAULT '0' COMMENT '狀態0:未啟用 1:正常 2:異常' AFTER `Enabled`,
ADD COLUMN `InstallDate` timestamp NULL DEFAULT NULL COMMENT '安裝日期' AFTER `Status`,
ADD COLUMN `InverterName` varchar(50) DEFAULT NULL COMMENT '逆變器名稱' AFTER `SerialNumber`,
ADD COLUMN `Brand` varchar(50) DEFAULT NULL COMMENT '廠牌' AFTER `ControllerId`,
ADD COLUMN `Model` varchar(50) DEFAULT NULL COMMENT '型號' AFTER `Brand`,
ADD COLUMN `Capacity` double(10,3) DEFAULT NULL COMMENT '裝置容量 kWp' AFTER `Model`,
ADD COLUMN `Pyrheliometer` int(10) DEFAULT NULL COMMENT '日照計設備流水號'AFTER `Capacity`;
-- 子DB裝置列表新增欄位 20210708
ALTER TABLE `device`
ADD COLUMN `Enabled` tinyint(4) NOT NULL DEFAULT '0' COMMENT '是否啟用, 0:否 1:是' AFTER `PowerStationId`,
ADD COLUMN `InstallDate` timestamp NULL DEFAULT NULL COMMENT '安裝日期' AFTER `ColName`,
DROP COLUMN `Remark`,
/*!40101 SET SQL_MODE=IFNULL(@OLD_SQL_MODE, '') */;

View File

@ -452,8 +452,10 @@ namespace SolarPower.Repository.Implement
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`UID` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL COMMENT ' ++(0001~9999)+(3) + SN(3)',
`PowerStationId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`SerialNumber` varchar(4) COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '',
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Enabled` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`Status` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1: 2:',
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT '0' COMMENT '',
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TypeName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`ControllerId` int(10) unsigned DEFAULT NULL COMMENT 'Id',
@ -462,7 +464,7 @@ namespace SolarPower.Repository.Implement
`DBName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`TableName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`ColName` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL,
`Remark` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci COMMENT '',
`InstallDate` timestamp NULL DEFAULT NULL COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '',
@ -476,9 +478,17 @@ namespace SolarPower.Repository.Implement
CREATE TABLE IF NOT EXISTS `inverter` (
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT '',
`Deleted` tinyint(4) DEFAULT '0' COMMENT '',
`Enabled` tinyint(4) DEFAULT '0' COMMENT '0: 1:',
`Status` tinyint(4) DEFAULT '0' COMMENT '0: 1: 2:',
`InstallDate` timestamp NULL DEFAULT NULL COMMENT '',
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci DEFAULT NULL COMMENT '()',
`InverterName` varchar(50) DEFAULT NULL COMMENT '',
`InverterId` varchar(50) DEFAULT NULL COMMENT 'UID',
`ControllerId` int(10) DEFAULT NULL COMMENT '',
`Brand` varchar(50) DEFAULT NULL COMMENT '',
`Model` varchar(50) DEFAULT NULL COMMENT '',
`Capacity` double(10,3) DEFAULT NULL COMMENT ' kWp',
`Pyrheliometer` int(10) DEFAULT NULL COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL,
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`UpdatedBy` int(10) DEFAULT NULL,