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