my-home-dashboard

gas_monthly_usages

Description

月間ガス使用状況

Table Definition ```sql CREATE TABLE `gas_monthly_usages` ( `gas_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_begin_at` date NOT NULL COMMENT '開始日', `usage_end_at` date NOT NULL COMMENT '終了日', `usage_amount` decimal(15,5) unsigned NOT NULL COMMENT '使用量(m^3)', `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 (`gas_fetch_setting_id`,`usage_year`,`usage_month`), CONSTRAINT `fk_gas_monthly_usages_gas_fetch_setting_id` FOREIGN KEY (`gas_fetch_setting_id`) REFERENCES `gas_fetch_settings` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci COMMENT='月間ガス使用状況' ```

Columns

Name Type Default Nullable Extra Definition Children Parents Comment
gas_fetch_setting_id bigint(20) unsigned   false     gas_fetch_settings ガス料金取得設定ID
usage_year int(10) unsigned   false      
usage_month int(10) unsigned   false      
usage_begin_at date   false       開始日
usage_end_at date   false       終了日
usage_amount decimal(15,5) unsigned   false       使用量(m^3)
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_gas_monthly_usages_gas_fetch_setting_id FOREIGN KEY FOREIGN KEY (gas_fetch_setting_id) REFERENCES gas_fetch_settings (id)
PRIMARY PRIMARY KEY PRIMARY KEY (gas_fetch_setting_id, usage_year, usage_month)

Indexes

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

Relations

er


Generated by tbls