my-home-dashboard

electricity_monthly_usages

Description

月間電気使用状況

Table Definition ```sql CREATE TABLE `electricity_monthly_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_day_count` int(10) unsigned NOT NULL COMMENT '使用日数', `usage_kwh` int(10) unsigned NOT NULL COMMENT '使用量(kWh)', `usage_yen` int(10) unsigned NOT NULL COMMENT '料金(円)', `created_at` datetime NOT NULL DEFAULT current_timestamp() COMMENT '作成日時', `updated_at` datetime NOT NULL DEFAULT current_timestamp() ON UPDATE current_timestamp() COMMENT '更新日時', PRIMARY KEY (`electricity_fetch_setting_id`,`usage_year`,`usage_month`), CONSTRAINT `fk_electricity_monthly_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_day_count int(10) unsigned   false       使用日数
usage_kwh int(10) unsigned   false       使用量(kWh)
usage_yen int(10) unsigned   false       料金(円)
created_at datetime current_timestamp() false       作成日時
updated_at datetime current_timestamp() false on update current_timestamp()     更新日時

Constraints

Name Type Definition
fk_electricity_monthly_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)

Indexes

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

Relations

er


Generated by tbls