1. 修改子資料庫db schema

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

View File

@ -522,58 +522,60 @@ namespace SolarPower.Repository.Implement
-- power_station
CREATE TABLE IF NOT EXISTS `power_station` (
`Id` int(10) unsigned NOT NULL DEFAULT '0',
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`CompanyId` 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 '',
`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 '',
`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 '',
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:',
`EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '',
`EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT '0.0' COMMENT '()',
`PowerRate` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '',
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '(%)',
`TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '()',
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`TPCPurchaseElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellElectricityAt` timestamp NULL DEFAULT NULL COMMENT '',
`kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`kwhkwp` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
`PR` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Pr值',
`MP` decimal(5,2) unsigned NOT NULL DEFAULT '0.00',
`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',
`TodayWeather` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL DEFAULT '0.000' COMMENT '',
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '',
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`Id`),
KEY `IDX_01` (`Deleted`),
KEY `IDX_02` (`CompanyId`),
KEY `IDX_03` (`CityId`,`AreaId`)
`Id` int(10) unsigned NOT NULL AUTO_INCREMENT,
`Deleted` tinyint(4) NOT NULL DEFAULT '0' COMMENT ' 0: 1:',
`CompanyId` 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 '',
`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 '',
`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 '++',
`SerialNumber` varchar(4) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`IsEscrow` tinyint(4) NOT NULL DEFAULT '0' COMMENT '0: 1:',
`EscrowName` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`ElectricityMeterAt` timestamp NULL DEFAULT NULL COMMENT '',
`EstimatedRecoveryTime` varchar(10) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`GeneratingCapacity` decimal(10,1) NOT NULL DEFAULT '0.0' COMMENT '()',
`PowerRate` decimal(10,3) NOT NULL DEFAULT '0.000' COMMENT '',
`Coordinate` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`InverterAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`PhotovoltaicPanelBrand` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelProductModel` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelSpecification` varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`PhotovoltaicPanelAmount` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEFileName` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEFile` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoEDiscountRate` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`BoEDeviceRegisterNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`BoERentRatio` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '(%)',
`TPCContractNumber` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci DEFAULT NULL COMMENT '',
`TPCContractAt` timestamp NULL DEFAULT NULL COMMENT '',
`TPCSellDeadline` int(10) unsigned DEFAULT '0' COMMENT '()',
`TPCMeterReading` int(10) unsigned NOT NULL DEFAULT '0' COMMENT '',
`TPCPurchaseElectricityAt` 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',
`Today_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`Total_kwh` decimal(10,3) unsigned NOT NULL DEFAULT '0.000' COMMENT '',
`kwhkwp` decimal(10,3) unsigned NOT NULL DEFAULT '0.000',
`PR` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT 'Pr值',
`MP` decimal(5,2) unsigned NOT NULL DEFAULT '0.00',
`SolarHour` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`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 DEFAULT NULL COMMENT '',
`TodayWeatherTemp` decimal(5,2) unsigned NOT NULL DEFAULT '0.00' COMMENT '',
`CreatedBy` int(10) unsigned NOT NULL COMMENT '',
`CreatedAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT '',
`UpdatedBy` int(10) unsigned DEFAULT NULL COMMENT '',
`UpdatedAt` timestamp NULL DEFAULT NULL ON UPDATE CURRENT_TIMESTAMP COMMENT '',
PRIMARY KEY (`Id`),
KEY `IDX_01` (`Deleted`),
KEY `IDX_02` (`CompanyId`),
KEY `IDX_03` (`CityId`,`AreaId`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='';
-- power_station_exception