1. 修改子資料庫db schema

This commit is contained in:
Kai 2021-06-29 13:55:47 +08:00
parent 2d31f5dcc1
commit 967c68bd3a

View File

@ -522,13 +522,14 @@ namespace SolarPower.Repository.Implement
-- power_station -- power_station
CREATE TABLE IF NOT EXISTS `power_station` ( CREATE TABLE IF NOT EXISTS `power_station` (
`Id` int(10) unsigned NOT NULL DEFAULT '0', `Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:', `Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `CompanyId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`CityId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `CityId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`AreaId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `AreaId` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `Address` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `Name` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`MainDisplay` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '++', `Code` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '++',
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '', `SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:', `IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:',
@ -556,6 +557,7 @@ namespace SolarPower.Repository.Implement
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '', `TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '', `TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '', `TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`SolarType` tinyint(4) NOT NULL DEFAULT '0' COMMENT '',
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000', `kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '', `Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '', `Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
@ -563,8 +565,8 @@ namespace SolarPower.Repository.Implement
`PR` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Pr值', `PR` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Pr值',
`MP` decimal(5,2) unsigned NOT NULL DEFAULT '0.00', `MP` decimal(5,2) unsigned NOT NULL DEFAULT '0.00',
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '', `SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT ' DB name: solar_com', `SiteDB` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT ' DB name: solar_com',
`TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '', `TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '', `TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '', `CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '', `CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',