my-home-dashboard

electricity_daily_usages

Description

日間電気使用状況

Table Definition ```sql CREATE TABLE `electricity_daily_usages` ( `electricity_fetch_setting_id` bigint(20) unsigned NOT NULL COMMENT '電気料金取得設定ID', `usage_year` int(10) unsigned NOT NULL COMMENT '年', `usage_month` int(10) unsigned NOT NULL COMMENT '月', `usage_date` int(10) unsigned NOT NULL COMMENT '日', `usage_amount` decimal(15,5) unsigned NOT NULL COMMENT '使用量(kWh)', `created_at` datetime NOT NULL DEFAULT current_timestamp() COMMENT '作成日時(UTC)', `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '更新日時(UTC)', PRIMARY KEY (`electricity_fetch_setting_id`,`usage_year`,`usage_month`,`usage_date`), CONSTRAINT `fk_electricity_daily_usages_electricity_fetch_setting_id` FOREIGN KEY (`electricity_fetch_setting_id`) REFERENCES `electricity_fetch_settings` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='日間電気使用状況' ```

Columns

Name Type Default Nullable Extra Definition Children Parents Comment
electricity_fetch_setting_id bigint(20) unsigned   false     electricity_fetch_settings 電気料金取得設定ID
usage_year int(10) unsigned   false      
usage_month int(10) unsigned   false      
usage_date int(10) unsigned   false      
usage_amount decimal(15,5) unsigned   false       使用量(kWh)
created_at datetime current_timestamp() false       作成日時(UTC)
updated_at datetime current_timestamp() false on update current_timestamp()     更新日時(UTC)

Constraints

Name Type Definition
fk_electricity_daily_usages_electricity_fetch_setting_id FOREIGN KEY FOREIGN KEY (electricity_fetch_setting_id) REFERENCES electricity_fetch_settings (id)
PRIMARY PRIMARY KEY PRIMARY KEY (electricity_fetch_setting_id, usage_year, usage_month, usage_date)

Indexes

Name Definition
PRIMARY PRIMARY KEY (electricity_fetch_setting_id, usage_year, usage_month, usage_date) USING BTREE

Relations

er


Generated by tbls