#!/usr/bin/env ruby
require File.expand_path('../../../config/environment', __FILE__)

ForeignKey.disabled
Swars::Battle.destroy_all
Swars::User.destroy_all

Swars::Importer::FullHistoryImporter.new(user_key: "DevUser1").call

tp Swars::Membership
# >> [fetch][history] https://shogiwars.heroz.jp/games/history?gtype=&page=1&user_id=DevUser1
# >> DevUser1 P1 10分 [全3件][新3件][最後]
# >> 最後のページと思われるので終わる
# >> [fetch][record] https://shogiwars.heroz.jp/games/DevUser1-YamadaTaro-20200101_123401?locale=ja
# >> [fetch][record] https://shogiwars.heroz.jp/games/DevUser2-YamadaTaro-20200101_123402?locale=ja
# >> [fetch][record] https://shogiwars.heroz.jp/games/DevUser3-YamadaTaro-20200101_123403?locale=ja
# >> [fetch][history] https://shogiwars.heroz.jp/games/history?gtype=sb&page=1&user_id=DevUser1
# >> DevUser1 P1 3分 [全3件][新0件][最後]
# >> 最後のページと思われるので終わる
# >> [fetch][history] https://shogiwars.heroz.jp/games/history?gtype=s1&page=1&user_id=DevUser1
# >> DevUser1 P1 10秒 [全3件][新0件][最後]
# >> 最後のページと思われるので終わる
# >> |-----+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+------------+-----------+---------------+----------+-------------+----------+-----------------------+--------------------+---------------+-------------+------------------+-----------------+--------------------+---------------+----------------|
# >> | id  | battle_id | user_id | op_user_id | grade_id | position | grade_diff | created_at                | updated_at                | think_all_avg | think_end_avg | think_last | think_max | ai_drop_total | judge_id | location_id | style_id | ek_score_without_cond | ek_score_with_cond | ai_wave_count | ai_two_freq | defense_tag_list | attack_tag_list | technique_tag_list | note_tag_list | other_tag_list |
# >> |-----+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+------------+-----------+---------------+----------+-------------+----------+-----------------------+--------------------+---------------+-------------+------------------+-----------------+--------------------+---------------+----------------|
# >> | 139 |        70 |      69 |         70 |        8 |        0 |          1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |             7 |            14 |          6 |        58 |             0 |        1 |           1 |        1 |                    25 |                    |             0 |    0.236364 |                  |                 |                    |               |                |
# >> | 140 |        70 |      70 |         69 |        7 |        1 |         -1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |            10 |            21 |         55 |        98 |             0 |        2 |           2 |        1 |                     8 |                    |             0 |    0.127273 |                  |                 |                    |               |                |
# >> | 141 |        71 |      71 |         70 |        8 |        0 |          1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |             7 |            14 |          6 |        58 |             0 |        1 |           1 |        1 |                    25 |                    |             0 |    0.236364 |                  |                 |                    |               |                |
# >> | 142 |        71 |      70 |         71 |        7 |        1 |         -1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |            10 |            21 |         55 |        98 |             0 |        2 |           2 |        1 |                     8 |                    |             0 |    0.127273 |                  |                 |                    |               |                |
# >> | 143 |        72 |      72 |         70 |        8 |        0 |          1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |             7 |            14 |          6 |        58 |             0 |        1 |           1 |        1 |                    25 |                    |             0 |    0.236364 |                  |                 |                    |               |                |
# >> | 144 |        72 |      70 |         72 |        7 |        1 |         -1 | 2024-05-03 20:53:04 +0900 | 2024-05-03 20:53:04 +0900 |            10 |            21 |         55 |        98 |             0 |        2 |           2 |        1 |                     8 |                    |             0 |    0.127273 |                  |                 |                    |               |                |
# >> |-----+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+------------+-----------+---------------+----------+-------------+----------+-----------------------+--------------------+---------------+-------------+------------------+-----------------+--------------------+---------------+----------------|
