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

Swars::Battle.destroy_all
Swars::User.destroy_all

user1 = Swars::User.create!
user2 = Swars::User.create!

Swars::Battle.create! do |e|
  e.memberships.build(user: user1)
  e.memberships.build(user: user2)
end

tp Swars::Membership
tp Swars::Style

# >> |------+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+----------------+------------+-----------+---------------+--------------+----------+-------------+----------+------------------+-----------------+--------------------+---------------+----------------|
# >> | id   | battle_id | user_id | op_user_id | grade_id | position | grade_diff | created_at                | updated_at                | think_all_avg | think_end_avg | two_serial_max | think_last | think_max | obt_think_avg | ai_drop_total | judge_id | location_id | style_id | defense_tag_list | attack_tag_list | technique_tag_list | note_tag_list | other_tag_list |
# >> |------+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+----------------+------------+-----------+---------------+--------------+----------+-------------+----------+------------------+-----------------+--------------------+---------------+----------------|
# >> | 3143 |      1670 |     448 |        449 |       40 |        0 |          0 | 2022-12-11 19:43:24 +0900 | 2022-12-11 19:43:24 +0900 |             2 |             2 |              1 |          2 |         5 |               |              |        1 |           1 |        2 |                  |                 |                    |               |                |
# >> | 3144 |      1670 |     449 |        448 |       40 |        1 |          0 | 2022-12-11 19:43:24 +0900 | 2022-12-11 19:43:24 +0900 |             5 |             5 |                |          7 |         7 |               |              |        2 |           2 |        3 |                  |                 |                    |               |                |
# >> |------+-----------+---------+------------+----------+----------+------------+---------------------------+---------------------------+---------------+---------------+----------------+------------+-----------+---------------+--------------+----------+-------------+----------+------------------+-----------------+--------------------+---------------+----------------|
# >> |----+--------+----------+---------------------------+---------------------------|
# >> | id | key    | position | created_at                | updated_at                |
# >> |----+--------+----------+---------------------------+---------------------------|
# >> |  1 | 王道   |        0 | 2022-12-11 18:07:03 +0900 | 2022-12-11 18:07:03 +0900 |
# >> |  2 | 準王道 |        1 | 2022-12-11 18:07:03 +0900 | 2022-12-11 18:07:03 +0900 |
# >> |  3 | 準変態 |        2 | 2022-12-11 18:07:03 +0900 | 2022-12-11 18:07:03 +0900 |
# >> |  4 | 変態   |        3 | 2022-12-11 18:07:03 +0900 | 2022-12-11 18:07:03 +0900 |
# >> |----+--------+----------+---------------------------+---------------------------|
