提交 96f87643 编写于 作者: nengyuangzhang's avatar nengyuangzhang

added command relation tables with microgrids, spaces, stores, shopfloors and tenants

上级 2c596dee
......@@ -9,6 +9,11 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- added tbl_combianed_equipments_commands to myems_system_db database
- added tbl_equipments_commands to myems_system_db database
- added tbl_meters_commands to myems_system_db database
- added tbl_microgrids_commands to myems_system_db database
- added tbl_spaces_commands to myems_system_db database
- added tbl_stores_commands to myems_system_db database
- added tbl_shopfloors_commands to myems_system_db database
- added tbl_tenants_commands to myems_system_db database
- added command actions to myems-api
- added command feature to myems-admin
- added tbl_new_users to myems_user_db database
......
......@@ -605,7 +605,7 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_meters_commands` (
`meter_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_meters_comands_index_1` ON `myems_system_db`.`tbl_meters_comands` (`meter_id`);
CREATE INDEX `tbl_meters_commands_index_1` ON `myems_system_db`.`tbl_meters_commands` (`meter_id`);
-- ---------------------------------------------------------------------------------------------------------------------
......@@ -631,6 +631,17 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_microgrids` (
PRIMARY KEY (`id`));
CREATE INDEX `tbl_microgrids_index_1` ON `myems_system_db`.`tbl_microgrids` (`name`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_microgrids_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_microgrids_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_microgrids_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`microgrid_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_microgrids_commands_index_1` ON `myems_system_db`.`tbl_microgrids_commands` (`microgrid_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_microgrid_architecture_types`
......@@ -815,6 +826,18 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_shopfloors` (
PRIMARY KEY (`id`));
CREATE INDEX `tbl_shopfloors_index_1` ON `myems_system_db`.`tbl_shopfloors` (`name`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_shopfloors_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_shopfloors_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_shopfloors_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`shopfloor_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_shopfloors_commands_index_1` ON `myems_system_db`.`tbl_shopfloors_commands` (`shopfloor_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_shopfloors_equipments`
-- ---------------------------------------------------------------------------------------------------------------------
......@@ -945,6 +968,18 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_spaces_combined_equipments` (
PRIMARY KEY (`id`));
CREATE INDEX `tbl_spaces_combined_equipments_index_1` ON `myems_system_db`.`tbl_spaces_combined_equipments` (`space_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_spaces_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_spaces_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_spaces_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`space_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_spaces_commands_index_1` ON `myems_system_db`.`tbl_spaces_commands` (`space_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_spaces_equipments`
-- ---------------------------------------------------------------------------------------------------------------------
......@@ -1133,6 +1168,18 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_stores` (
PRIMARY KEY (`id`));
CREATE INDEX `tbl_stores_index_1` ON `myems_system_db`.`tbl_stores` (`name`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_stores_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_stores_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_stores_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`store_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_stores_commands_index_1` ON `myems_system_db`.`tbl_stores_commands` (`store_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_store_types`
-- ---------------------------------------------------------------------------------------------------------------------
......@@ -1245,6 +1292,18 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_tenants` (
PRIMARY KEY (`id`));
CREATE INDEX `tbl_tenants_index_1` ON `myems_system_db`.`tbl_tenants` (`name`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_tenants_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_tenants_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_tenants_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`tenant_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_tenants_commands_index_1` ON `myems_system_db`.`tbl_tenants_commands` (`tenant_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_tenant_types`
-- ---------------------------------------------------------------------------------------------------------------------
......
......@@ -56,7 +56,67 @@ CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_meters_commands` (
`meter_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_meters_comands_index_1` ON `myems_system_db`.`tbl_meters_comands` (`meter_id`);
CREATE INDEX `tbl_meters_commands_index_1` ON `myems_system_db`.`tbl_meters_commands` (`meter_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_microgrids_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_microgrids_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_microgrids_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`microgrid_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_microgrids_commands_index_1` ON `myems_system_db`.`tbl_microgrids_commands` (`microgrid_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_spaces_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_spaces_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_spaces_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`space_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_spaces_commands_index_1` ON `myems_system_db`.`tbl_spaces_commands` (`space_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_tenants_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_tenants_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_tenants_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`tenant_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_tenants_commands_index_1` ON `myems_system_db`.`tbl_tenants_commands` (`tenant_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_shopfloors_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_shopfloors_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_shopfloors_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`shopfloor_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_shopfloors_commands_index_1` ON `myems_system_db`.`tbl_shopfloors_commands` (`shopfloor_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_stores_commands`
-- ---------------------------------------------------------------------------------------------------------------------
DROP TABLE IF EXISTS `myems_system_db`.`tbl_stores_commands` ;
CREATE TABLE IF NOT EXISTS `myems_system_db`.`tbl_stores_commands` (
`id` BIGINT NOT NULL AUTO_INCREMENT,
`store_id` BIGINT NOT NULL,
`command_id` BIGINT NOT NULL,
PRIMARY KEY (`id`));
CREATE INDEX `tbl_stores_commands_index_1` ON `myems_system_db`.`tbl_stores_commands` (`store_id`);
-- ---------------------------------------------------------------------------------------------------------------------
-- Table `myems_system_db`.`tbl_microgrids`
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册