-- StaatsHub Stats Tabelle
-- Speichert Stats für alle Fraktionen

CREATE TABLE IF NOT EXISTS `staatshub_stats` (
  `id` INT(11) UNSIGNED NOT NULL AUTO_INCREMENT,
  `username` VARCHAR(50) NOT NULL,
  `fraction` INT(11) UNSIGNED NOT NULL DEFAULT 2,
  `fraction_name` VARCHAR(50) DEFAULT NULL,
  `last_update` TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `cop_ticket_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_ticket_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_wanteds_add` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_wanteds_remove` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_drugs_take` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_arrest_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_arrest_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_criminals_killed_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_criminals_killed_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_ketten_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_ketten_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_tower_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_tower_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_spraytag_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `cop_spraytag_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `cop_mats_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_points_add` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_points_remove` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_storage_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_storage_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_clamps_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_clamps_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_ticket_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_ticket_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_spraytag_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `oamt_spraytag_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_revive_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_revive_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_heal_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_heal_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_pakets_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `lsmd_pakets_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `safd_bushfire_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `safd_bushfire_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `safd_trashfire_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `safd_trashfire_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `safd_gasfire_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `safd_gasfire_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `safd_shopfire_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `safd_shopfire_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `safd_atmfire_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `safd_atmfire_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `news_zeitungen_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `news_zeitungen_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_atm_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_atm_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_mats_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_mats_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_fuel_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_fuel_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_prod_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_prod_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_inject_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `gmbh_uload_inject_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_laternen_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_laternen_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_ampel_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_ampel_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_strommast_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_strommast_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_atm_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_atm_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_tankstellen_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_tankstellen_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_spraytag_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_spraytag_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_gruenpflege_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_gruenpflege_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_sperrmuel_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_sperrmuel_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_laternen_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_laternen_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_pakautomat_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_pakautomat_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_zollstation_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_zollstation_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_busstop_count` INT(11) UNSIGNED NOT NULL DEFAULT 0,
  `sasw_sp_busstop_money` BIGINT(20) UNSIGNED NOT NULL DEFAULT 0,
  PRIMARY KEY (`id`),
  UNIQUE KEY `idx_username_fraction` (`username`, `fraction`),
  KEY `idx_fraction` (`fraction`),
  KEY `idx_fraction_name` (`fraction_name`),
  KEY `idx_last_update` (`last_update`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
