- データベース設計
- 共通関数
- 1. ユーザー(user)
- 2. チーム(team)
- 3. 選手(player)
- 4. 移籍(transfer)
- 5. 怪我(injury)
- 6. 国(country)
- 7. 代表試合シリーズ(National-Match-Series)
- 8. 代表召集リスト(National-Callup)
- 9. 審判(referee)
- 10. 大会(Competition)
- 11. シーズン(Season)
- 12. チームの大会参加記録(Team-Competition-Season)
- 13. スタジアム(Stadium)
- 14. 大会ステージ(Competition-Stage)
- 15. 試合フォーマット(Match-Format)
- 16. 試合(Match)
- 17. 選手登録(Player-Registration)
- 18. 選手登録履歴(Player-RegistrationHistory)
- 19. 試合イベント(Match-Event-Type)
- 20. フォーメーション(Formation)
- 21. 監督・コーチ(Staff)
- 22. 選手の出場履歴(Player-Appearance)
- 23. 監督・コーチの出場履歴(Staff-Appearance)
- 24. 選手の試合イベントログ(Player-Match-Event-Log)
- 25. 監督・コーチの試合イベントログ(Staff-Match-Event-Log)
- 26. 試合でのフォーメーション(Team-Match-Formation)
- 27. スタッフ登録(Staff-Registration)
- 28. スタッフ登録履歴(Staff-RegistrationHistory)
- 29. スタッツL(Stats-L)
- 30. 審判の出場履歴(Referee-Appearance)
- 今後
- . 出場停止
- . 監督キャリア
- . ポジション
- normalized_en_name の自動生成
function normalizeEnName(name: string): string {
return name
.toUpperCase()
.replace(/[^\p{L}\p{N}\s]/gu, "")
.split(/\s+/)
.filter(Boolean)
.sort()
.join(" ");
}
| フィールド | 型 | null | 注釈 | バリデーション |
|---|---|---|---|---|
| user_name | 文字列 | false | ユーザーの表示名 | 3 文字以上 |
| 文字列 | false | ユーザーのメールアドレス | メールアドレス形式,ユニーク | |
| password | 文字列 | false | ハッシュ化されたパスワード | 8 文字以上英数字 |
| created_at | 日付 | false | アカウント作成日 | 自動設定(登録時) |
| updated_at | 日付 | true | アカウント情報の最終更新日 | 自動設定(更新時) |
| admin | 真偽値 | false | 管理者権限の有無 | デフォルト(false) |
| is_staff | 真偽値 | false | スタッフ権限の有無 | デフォルト(false) |
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| team | 文字列 | チーム名 | true | |
| abbr | 文字列 | 略称 | ||
| enTeam | 文字列 | 英名 | ||
| country | 外部キー(Country) | 国名 | ||
| genre | 文字列 | ジャンル | ||
| age_group | 文字列 | 年代 | ||
| division | 文字列 | 2nd, 3rd など | 1st | |
| jdataid | 数字 | j.data.id | ||
| labalph | 文字列 | lab.alph | ||
| transferurl | 文字列 | transfer | ||
| sofaurl | 文字列 | sofa | ||
| normalized_name | 文字列 | チーム名 |
- genre:
club|national - age_group:
full|u17~u24|high_school|university|youth - division:
1st|2nd|3rd
transferurlは ユニークsofaurlは ユニーク
- client で入力させないフィールド
normalized_name
- normalized_name の自動生成
- team.normalize(
NFKC)で正規化
- team.normalize(
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英語名 | ||
| normalized_en_name | 文字列 | 正規済英名 | ||
| dob | 日付 | 生年月日 | ||
| pob | 文字列 | 出身地 |
- client で入力させないフィールド
normalized_en_name
- normalized_en_name の自動生成
normalizeEnName関数で処理
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| doa | 日付 | 発表日 | ||
| from_team | 外部キー(Team) | 所属元 | ||
| from_team_name | 文字列 | 所属元 | ||
| to_team | 外部キー(Team) | 移籍先 | ||
| to_team_name | 文字列 | 移籍先 | ||
| player | 外部キー(Player) | 選手 | true | |
| position | [文字列] | ポジション | ||
| form | 文字列 | 形態 | ||
| number | 数字 | 背番号 | ||
| from_date | 日付 | 移籍日 | true | |
| to_date | 日付 | 満了日 | ||
| URL | [URL] | URL | ||
| isCancelled | 真偽値 | キャンセル |
- position:
GK|DF|CB|RCB|LCB|SB|RSB|LSB|WB|RWB|LWB|MF|CM|DM|OM|WG|RSH|LSH|RWG|LWG|CF|FW - form:
完全|期限付き|期限付き満了|期限付き解除|
育成型期限付き|育成型期限付き満了|育成型期限付き解除|
満了|退団|引退|
期限付き延長|育成型期限付き延長|
契約解除|復帰|離脱|更新
以下の組み合わせで ユニーク とする:
from_team(任意)from_team_name(任意)to_team(任意)to_team_name(任意)playerform(任意)from_dateto_date(任意)
- from 系 または to 系 少なくとも一方は入力
- from_team または from_team_name どちらかを入力
- to_team または to_team_name どちらかを入力
- to_date は from_date より後
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| doa | 日付 | 公式発表 | true | |
| team | 外部キー(Team) | チーム | ||
| team_name | 文字列 | チーム | ||
| now_team | 外部キー(Team) | 現所属 | ||
| player | 外部キー(Player) | 選手 | true | |
| doi | 日付 | 負傷日 | ||
| dos | 日付 | 手術日 | ||
| injured_part | [文字列] | 負傷箇所・診断結果 | ||
| is_injured | 真偽値 | 負傷中 | true | |
| ttp | 文字列 | 全治期間※1 | ||
| erd | 日付 | 復帰予測※2 | ||
| URL | [URL] |
以下の組み合わせで ユニーク とする:
team(任意)team_name(任意)playerdoi(任意)dos(任意)injured_part(任意)
- team または team_name どちらかを入力
- erd は doi , dos より後
- ttp は
数字 + d or w or m or yで入力 例) 1d , 1w, 10w-15w, 2m-3m, 10w-5m
- erd の自動生成
- erd の値が undefined かつ ttp の値が undefined でないとき doi または dos を基準に ttp を用いて計算
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英語名 | ||
| iso3 | 文字列 | 英 3 文字コード | ||
| fifa_code | 文字列 | 英 3 文字コード | ||
| area | 文字列 | 地域 | ||
| district | 文字列 | 詳細地域 | ||
| confederation | 文字列 | 所属地域協会 | ||
| sub_confederation | 文字列 | 所属詳細地域協会 | ||
| established_year | 数字 | 協会成立年 | ||
| fifa_member_year | 数字 | FIFA 加入年 | ||
| association_member_year | 数字 | 地域協会加入年 | ||
| district_member_year | 数字 | 詳細地域協会加入年 | ||
| old_id | 文字列 | 旧id |
- area:
アジア|ヨーロッパ|アフリカ|オセアニア|北アメリカ|南極|南アメリカ|ミクロネシア - district:
中央アジア|北ヨーロッパ|南ヨーロッパ|北アフリカ|ポリネシア|
南部アフリカ|カリブ海|南極大陸|南アメリカ大陸|西アジア|
オーストラリア大陸|中央ヨーロッパ|中東|南アジア|東ヨーロッパ|
西ヨーロッパ|中央アメリカ|西アフリカ|北大西洋|東南アジア|
東アフリカ|中央アフリカ|北アメリカ大陸|中部アフリカ|東アジア|
東部アフリカ|南大西洋|メラネシア|インド洋および南極大陸|
ミクロネシア|インド洋|東南アフリカ|オセアニア大陸|大西洋|北部アフリカ - confederation:
AFC|UEFA|CAF|OFC|CONCACAF|CONMEBOL|FSMFA - sub_confederation:
CAFA|UNAF|COSAFA|CFU|AFF|WAFF|SAFF|
UNCAF|WAFU|CECAFA|UNIFFAC|NAFU|EAFF
以下の組み合わせで ユニーク とする:
iso3(任意)name
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | シリーズ名 | true | |
| abbr | 文字列 | 略称 | ||
| country | 外部キー(Country) | 国 | true | |
| age_group | 文字列 | 年代 | ||
| matches | [外部キー(Match)] | 試合 | ||
| joined_at | 日付 | 合流日 | ||
| left_at | 日付 | 離脱日 | ||
| urls | [URL] | URL |
- age_group:
full|u17~u24|high_school|university|youth
以下の組み合わせで ユニーク とする:
countryage_group(任意)joined_at(任意)
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| series | 外部キー(NationalMatchSeries) | 試合シリーズ | true | |
| player | 外部キー(Player) | 選手 | true | |
| team | 外部キー(Team) | 所属チーム | ||
| team_name | 文字列 | 所属チーム | ||
| joined_at | 日付 | 合流日 | ||
| left_at | 日付 | 離脱日 | ||
| number | 数字 | 背番号 | ||
| position_group | 文字列 | ポジション | ||
| is_captain | 真偽値 | キャプテン | true | false |
| is_overage | 真偽値 | オーバーエイジ | true | false |
| is_backup | 真偽値 | バックアップ | true | false |
| is_training_partner | 真偽値 | パートナー | true | false |
| is_additional_call | 真偽値 | 追加招集 | true | false |
| status | 文字列 | 招集状況 | true | joined |
| left_reason | 文字列 | 離脱理由 |
- position_group:
GK|DF|MF|FW|MF/FW - status:
called|joined|declined|withdrawn - left_reason:
injury|personal|management|club|other|condition|suspension|transfer
以下の組み合わせで ユニーク とする:
seriesplayer
- team または team_name どちらかを入力
- status == decliend のときは joinjed_at と left_at は undefined
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英名 | ||
| normalized_en_name | 文字列 | 正規済英名 | ||
| dob | 日付 | 生年月日 | ||
| pob | 文字列 | 出身地 | ||
| citizenship | [外部キー(Country)] | 国籍 | ||
| player | 外部キー(Player) | 選手 | ||
| transferurl | 文字列 | transfer | ||
| sofaurl | 文字列 | sofa | ||
| old_id | 文字列 | 旧id |
transferurlは ユニークsofaurlは ユニーク
以下の組み合わせで ユニーク とする:
countryage_group(任意)joined_at(任意)
- client で入力させないフィールド
normalized_en_name
- normalized_en_name の自動生成
normalizeEnName関数で処理
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 大会名 | true | |
| abbr | 文字列 | 略称 | ||
| en_name | 文字列 | 英名 | ||
| country | 外部キー(Country) | 国 | ||
| competition_type | 文字列 | 大会規模 | true | |
| category | 文字列 | 大会タイプ | ||
| level? | 文字列 | 大会レベル | ||
| age_group? | 文字列 | 年代 | ||
| official_match? | 真偽値 | 公式戦 | ||
| transferurl? | 文字列 | transfer | ||
| sofaurl? | 文字列 | sofa |
- competition_type:
club|national|other - category:
league|cup|po|friendly|qualification - level:
1部~6部|リーグカップ|国内カップ戦|国内スーパーカップ|入れ替え|地域大会|地域予選|世界大会 - age_group:
full|u17~u24|high_school|university|youth
transferurlは ユニークsofaurlは ユニーク
以下の組み合わせで ユニーク とする:
namecountry(任意)joined_at(任意)
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| competition | 外部キー(Competition) | 大会 | true | |
| name | 文字列 | 名称 | true | |
| start_date | 日付 | シーズン開始日 | ||
| end_date | 日付 | シーズン終了日 | ||
| current | 真偽値 | 現在のシーズンか | ||
| note | 文字列 | 備考 |
以下の組み合わせで ユニーク とする:
competitionstart_date(任意)
nameの 例 "2023","2023-2024"
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| team | 外部キー(Team) | チーム | true | |
| season | 外部キー(Season) | シーズン | true | |
| competition | 外部キー(Competition) | 大会 | true | |
| note | 文字列 | 備考 |
以下の組み合わせで ユニーク とする:
teamseasoncompetition
- client で入力させないフィールド
competiton
- competition の自動生成
seasonモデルから取得
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| abbr | 文字列 | 略称 | ||
| en_name | 文字列 | 英語名 | ||
| alt_names | [文字列] | 別名 | ||
| alt_abbrs | [文字列] | 別略称 | ||
| alt_en_names | [文字列] | 別英語名 | ||
| country | 外部キー(Country) | 国 | ||
| transferurl | 文字列 | transfer | ||
| sofaurl | 文字列 | sofa |
transferurlは ユニークsofaurlは ユニーク
以下の組み合わせで ユニーク とする:
namecountry(任意)
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| competition | 外部キー(Competition) | 大会 | true | |
| season | 外部キー(Season) | シーズン | true | |
| stage_type | 文字列 | ステージタイプ | true | |
| name | 文字列 | ステージ名 | ||
| round_number | 数字 | 数字で表すラウンド | ||
| leg | 数字 | 第 1 戦、第 2 戦など | ||
| order | 数字 | 表示順 | ||
| parent_stage | 外部キー(CompetitionStage) | 親ステージ | ||
| notes | 文字列 | 備考 |
- stage_type:
none|group_stage|round|quarter_final|semi_final|final|other
以下の組み合わせで ユニーク とする:
competitionseasonstage_typeround_number(任意)leg(任意)
- stage_type == none のときは name, round_number, leg, order, が undefined
- client で入力させないフィールド
competiton
- competition の自動生成
seasonモデルから取得
nameの例 (例: "準決勝", "決勝", "Group Stage A")round_numberの例 (例: 1=1 回戦, 2=2 回戦)
※ parent_stage は 同じ competition/season 内のステージだけ親にできる
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 名前 | 名前 | true | |
| period | 配列 |
- {period_label : 文字列, start : 数字 , end : 数字}
-
period_label:
1H|2H|ET1|ET2|3H|PK|GB -
例 1 "match_format": [ { "period_label": "1H", "start": 0, "end": 45 }, { "period_label": "2H", "start": 45, "end": 90 }, { "period_label": "ET1", "start": 90, "end": 105 }, { "period_label": "ET2", "start": 105, "end": 120 } ]
-
例 2 "match_format": [ { "period_label": "1H", "start": 0, "end": 45 }, { "period_label": "2H", "start": 45, "end": 90 }, { "period_label": "PK", "start": null, "end": null } ]
-
例 3 "match_format": [ { "period_label": "1H", "start": 0, "end": 30 }, { "period_label": "2H", "start": 30, "end": 60 }, { "period_label": "3H", "start": 60, "end": 90 } ]
nameは ユニークperiodは ユニーク
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| competition | 外部キー(Competition) | 大会 | true | |
| competition_stage | 外部キー(CompetitionStage) | ステージ | true | |
| season | 外部キー(Season) | シーズン | true | |
| home_team | 外部キー(Team) | ホーム | true | |
| away_team | 外部キー(Team) | アウェイ | true | |
| match_format | 外部キー(MatchFormat) | 試合フォーマット | ||
| stadium | 外部キー(Stadium) | スタジアム | ||
| play_time | 数字 | プレイ時間 | ||
| date | 日付 | 開催日 | ||
| audience | 数字 | 観客数 | ||
| home_goal | 数字 | ホーム得点 | ||
| away_goal | 数字 | アウェイ得点 | ||
| home_pk_goal | 数字 | ホーム PK 得点 | ||
| away_pk_goal | 数字 | アウェイ PK 得点 | ||
| result | 文字列 | 試合結果 | ||
| match_week | 数字 | 節 | ||
| weather | 文字列 | 天気 | ||
| temperature | 数字 | 気温 | ||
| humidity | 数字 | 湿度 | ||
| transferurl | 文字列 | transfer | ||
| sofaurl | 文字列 | sofa | ||
| urls | [文字列] | urls | ||
| old_id | 文字列 | 旧 match_id | ||
| name | 文字列 | 名前 | true |
- result:
home|away|draw
transferurlは ユニークsofaurlは ユニークold_idは ユニーク
以下の組み合わせで ユニーク とする:
competitioncompetition_stagehome_teamaway_teamdate(任意)
以下の組み合わせで ユニーク とする:
competitioncompetition_stagehome_teamaway_teammatch_week(任意)
- client で入力させないフィールド
competitonseasonplay_timeresultname
- competition の自動生成
competition_stageモデルから取得
- season の自動生成
competition_stageモデルから取得
- play_time の自動生成
※match_formatモデルから取得
- result の自動生成
※goal, pk_goalから計算
- name の自動生成
- 各フィールド・モデルからname or abbrを取得して結合
- seasonモデル name
- competitionモデル abbr or name
- competition_stageモデル name
- match_week
- home_team teamモデル abbr or name
- away_team teamモデル abbr or name
${season.name} ${competition.abbr ?? competition.name} ${competition_stage.name} 第${match_week}節 ${homeTeam.abbr ?? homeTeam.team} vs ${awayTeam.abbr ?? awayTeam.team}
- 選手登録履歴(Player-RegistrationHistory)から自動更新するモデル
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| date | 日付 | 開催日 | ||
| season | 外部キー(Season) | シーズン | true | |
| competition | 外部キー(Competition) | 大会 | true | |
| player | 外部キー(Player) | 選手 | true | |
| team | 外部キー(Team) | チーム | true | |
| number | 数字 | 背番号 | ||
| position_group | 文字列 | ポジション | ||
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英語名 | ||
| registration_type | 文字列 | 登録・抹消 | true | |
| height | 数字 | 身長 | ||
| weight | 数字 | 体重 | ||
| homegrown | 真偽値 | ホームグロウン | ||
| registration_status | 文字列 | 登録状況 | true | |
| isTypeTwo | 真偽値 | 2 種登録 | ||
| isSpecialDesignation | 真偽値 | 特別指定 | ||
| note | 文字列 | 備考 |
- position_group:
GK|DF|MF|FW|MF/FW - registration_type:
register|deregister - registration_status:
active|terminated
以下の組み合わせで ユニーク とする:
dateseasonplayerteamregistration_type
- client で入力させないフィールド
competitonregistration_status
- competition の自動生成
seasonモデルから取得
- registration_status の自動生成
registration_type===registerがきたときseason,player, が一致する data を探す そのうち最新データのregistration_statusをactiveに, それ以外データはterminatedregistration_type===deregisterがきたときseason,player, が一致する data を探す そのうち送られてきたdateより前のデータのregistration_statusをterminatedに
[Player-RegistrationHistory] register ----→ [Player-Registration (registration_type === register)作成 + ※4]
[Player-RegistrationHistory] update ------→ [Player-Registration に差分適用]
[Player-RegistrationHistory] deregister --→ [Player-Registration (registration_type === deregister)作成 + ※5]
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| date | 日付 | 開催日 | ||
| season | 外部キー(Season) | シーズン | true | |
| competition | 外部キー(Competition) | 大会 | true | |
| player | 外部キー(Player) | 選手 | true | |
| team | 外部キー(Team) | チーム | true | |
| registration_type | 文字列 | 登録・抹消・変更 | true | |
| changes | オブジェクト | 変更点 |
- changes は以下の通り
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| number | 数字 | 背番号 | ||
| position | 文字列 | ポジション | ||
| name | 文字列 | 名前 | ||
| en_name | 文字列 | 英語名 | ||
| height | 数字 | 身長 | ||
| weight | 数字 | 体重 | ||
| homegrown | 真偽値 | ホームグロウン | ||
| isTypeTwo | 真偽値 | 2 種登録 | ||
| isSpecialDesignation | 真偽値 | 特別指定 | ||
| note | 文字列 | 備考 |
- position_group:
GK|DF|MF|FW|MF/FW - registration_type:
register|deregister
以下の組み合わせで ユニーク とする:
dateseasonplayerteamregistration_type
- registration_type === register の時
→
nameは 必須 - registration_type === change の時
→
changesは 必須
- client で入力させないフィールド
competiton
- competition の自動生成
seasonモデルから取得
- player , en_name の自動生成
playerモデルから取得
- changes の自動生成
registration_type===deregisterの時season,team,playerが一致する直前データのchangesを採用
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英名 | true | |
| abbr | 文字列 | 略称 | true | |
| event_type | 文字列 | イベントタイプ | true |
- event_type:
card|goal-assist|substitution
nameは ユニークen_nameは ユニークabbrは ユニーク
- 例: イエロー,レッド, イエロー 2 枚退場, 途中出場 , 途中交代, 得点 , アシスト, オウンゴール
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| position_formation | [文字列] | ポジション | true | |
| key | 文字列 | キー | true |
- position_formation:
GK|CB|LCB|RCB|RSB|LSB|LWB|RWB|DM|LCM|RCM|RIH|LIH|LSH|RSH|OM|LST|RST|RWG|LWG|RCF|LCF|CF
position_formationの 組み合わせユニーク
position_formationの 組み合わせユニークposition_formationの長さ 11
- client で入力させないフィールド
Key
- key の自動生成
key関数でposition_formationフィールドから作成
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英語名 | ||
| normalized_en_name | 文字列 | 正規済英名 | ||
| dob | 日付 | 生年月日 | ||
| citizenship | [外部キー(Country)] | 国籍 | ||
| pob | 文字列 | 出身地 | ||
| player | 外部キー(Player) | 選手 | ||
| old_id | 文字列 | 旧 match_id |
playerは ユニークold_idは ユニーク
- client で入力させないフィールド
old_idnormalized_en_name
- normalized_en_name の自動生成
normalizeEnName関数で処理
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー(Match) | 試合 | true | |
| player | 外部キー (Player) | 選手 | ||
| player_name | 文字列 | 選手名 | ||
| team | 外部キー(Team) | チーム | true | |
| number | 数字 | 背番号 | ||
| play_status | 文字列 | ステータス | ||
| position | 文字列 | ポジション | ||
| time | 数字 | プレイ時間 |
- play_status:
start|sub|bench - position:
GK|DF|CB|RCB|LCB|SB|RSB|LSB|WB|RWB|LWB|MF|CM|DM|OM|WG|RSH|LSH|RWG|LWG|CF|FW
以下の2つの組み合わせでユニークとする:
-
match -
team -
player -
match -
team -
player_name
- player または player_name どちらかを入力
- play_status が bench のとき time は undefined
- play_status が bench のとき position は undefined
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー | 試合 (Match) | true | |
| staff | 外部キー(Staff) | 監督 | ||
| staff_name | 文字列 | 監督名 | ||
| team | 外部キー | チーム (Team) | true | |
| role | 文字列 | 役割 |
以下の2つの組み合わせでユニークとする:
-
match -
team -
staff -
match -
team -
staff_name
- staff または staff_name どちらかを入力
roleの例 監督・コーチ・通訳など
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー(Match) | 試合 | true | |
| team | 外部キー (Team) | チーム | true | |
| match_event_type | 外部キー (MatchEventType) | イベントタイプ | true | |
| player | 外部キー (Player) | 選手 | ||
| player_name | 文字列 | 選手名 | ||
| time | 数字 | 時間 | ||
| add_time | 数字 | 追加タイム | ||
| special_time | 文字列(ENUM) | 特別時間 | ||
| period_label | 文字列(ENUM) | 前後半 | ||
| time_name | 文字列 | 文字列時間 | ||
| order | 数字 | 順番 | ||
| unique_key | 文字 | ユニークキー | true |
- special_time:
BT|HT|FT - period_label:
1H|2H|ET1|ET2|3H|PK|GB
以下の組み合わせを文字列とした値(unique_key)を ユニーク とする:
matchmatch_eventplayer(任意) orplayer_name(任意)orno-playertime_name(任意)orno-timeorder(任意) orno-order
- special_time 入力時
→
time,add_time, はundefined
- player または player_name どちらかを入力 (matchEventType がオウンゴール以外のとき)
- client で入力させないフィールド
time_nameperiod_label
- time_name の自動生成
${time}or${time}+${add_time}
- period_label の自動生成
- match モデルの match_format フィールド内の periold フィールド から time が当てはまる period_label を取得する
(例: match から得られる match_format の period が
{"period": [{"period_label": "1H","order": 1,"start": 0,"end": 45},{"period_label": "2H","order": 2,"start": 45,"end": 90}],}) ①:このとき time : 65 と入力されたら ②:start - end 間に 65 があるオブジェクトを探す ③:そのオブジェクトの period_label を period_label に入力 ④:period_label :2H
- match モデルの match_format フィールド内の periold フィールド から time が当てはまる period_label を取得する
(例: match から得られる match_format の period が
- オウンゴールについて
playerは失点した選手, チームは得点したチームにする timeは試合全体のうちの時間(後半 20 分は 65 と入力)
- 今後 order を PK 系イベントだけ require にする(matchEventType に依存)
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー(Match) | 試合 | true | |
| team | 外部キー(Team) | チーム | true | |
| match_event_type | 外部キー (MatchEventType) | イベントタイプ | true | |
| staff | 外部キー(Staff) | 監督 | ||
| staff_name | 文字列 | 監督名 | ||
| time | 数字 | 時間 | ||
| add_time | 数字 | 追加タイム | ||
| special_time | 文字列 | 特別時間 | ||
| period_label | 文字列 | 前後半 | ||
| time_name | 文字列 | 文字列時間 | ||
| unique_key | 文字 | ユニークキー | true |
- special_time:
BT|HT|FT - period_label:
1H|2H|ET1|ET2|3H|PK|GB
以下の組み合わせを文字列とした値(unique_key)を ユニーク とする:
matchmatch_eventstaff(任意) orstaff_name(任意)orno-stafftime_name(任意)orno-time
- staff または staff_name どちらかを入力
- special_time 入力時
→
time,add_timeはundefined
matchEventTypeは card 系のみ入力可能
- client で入力させないフィールド
time_nameperiod_label
- time_name の自動生成
${time}or${time}+${add_time}
- period_label の自動生成
- match モデルの match_format フィールド内の periold フィールド から time が当てはまる period_label を取得する
(例: match から得られる match_format の period が
{"period": [{"period_label": "1H","order": 1,"start": 0,"end": 45},{"period_label": "2H","order": 2,"start": 45,"end": 90}],}) ①:このとき time : 65 と入力されたら ②:start - end 間に 65 があるオブジェクトを探す ③:そのオブジェクトの period_label を period_label に入力 ④:period_label :2H
- match モデルの match_format フィールド内の periold フィールド から time が当てはまる period_label を取得する
(例: match から得られる match_format の period が
timeは試合全体のうちの時間(後半 20 分は 65 と入力)
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー(Match) | 試合 | true | |
| team | 外部キー(Team) | チーム | true | |
| formation | 外部キー(Formation) | フォーメーション | true |
以下の組み合わせで ユニーク とする:
matchteam
- スタッフ登録履歴(Staff-RegistrationHistory)から自動更新するモデル
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| date | 日付 | 開催日 | ||
| season | 外部キー(Season) | シーズン | true | |
| competition | 外部キー(Competition) | 大会 | true | |
| staff | 外部キー(Staff) | スタッフ | true | |
| team | 外部キー(Team) | チーム | true | |
| role | 文字列 | 役割 | ||
| name | 文字列 | 名前 | true | |
| en_name | 文字列 | 英語名 | ||
| registration_type | 文字列 | 登録・抹消 | true | |
| registration_status | 文字列 | 登録状況 | true | |
| note | 文字列 | 備考 |
- registration_type:
register|deregister - registration_status:
active|terminated
以下の組み合わせで ユニーク とする:
dateseasonstaffteamregistration_type
- client で入力させないフィールド
competitonregistration_status
- competition の自動生成
seasonモデルから取得
- registration_status の自動生成
registration_type===registerがきたときseason,staff, が一致する data を探す そのうち最新データのregistration_statusをactiveに, それ以外データはterminatedregistration_type===deregisterがきたときseason,staff, が一致する data を探す そのうち送られてきたdateより前のデータのregistration_statusをterminatedに
[Staff-RegistrationHistory] register ----→ [Staff-Registration (registration_type === register)作成 + ※4]
[Staff-RegistrationHistory] update ------→ [Staff-Registration に差分適用]
[Staff-RegistrationHistory] deregister --→ [Staff-Registration (registration_type === deregister)作成 + ※5]
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| date | 日付 | 開催日 | ||
| season | 外部キー(Season) | シーズン | true | |
| competition | 外部キー(Competition) | 大会 | true | |
| staff | 外部キー(Staff) | スタッフ | true | |
| team | 外部キー(Team) | チーム | true | |
| registration_type | 文字列 | 登録・抹消・変更 | true | |
| changes | オブジェクト | 変更点 |
- changes は以下の通り
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| role | 文字列 | 役割 | ||
| name | 文字列 | 名前 | ||
| en_name | 文字列 | 英語名 | ||
| note | 文字列 | 備考 |
- registration_type:
register|deregister
以下の組み合わせで ユニーク とする:
dateseasonstaffteamregistration_type
- registration_type === register の時
→
nameは 必須 - registration_type === change の時
→
changesは 必須
- client で入力させないフィールド
competiton
- competition の自動生成
seasonモデルから取得
- staff , en_name の自動生成
staffモデルから取得
- changes の自動生成
registration_type===deregisterの時season,team,staffが一致する直前データのchangesを採用
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー(Match) | 試合 | true | |
| team | 外部キー(Team) | チーム | true | |
| xgFor | 数字 | 得点期待値 | ||
| shootFor | 0以上整数 | シュート | ||
| onTargetFor | 0以上整数 | 枠内シュート | ||
| pkShootFor | 0以上整数 | PKによるシュート | ||
| passFor | 0以上整数 | パス | ||
| crossFor | 0以上整数 | クロス | ||
| directFkFor | 0以上整数 | 直接FK | ||
| indirectFkFor | 0以上整数 | 間接FK | ||
| cornerKickFor | 0以上整数 | CK | ||
| throwInFor | 0以上整数 | スローイン | ||
| dribbleFor | 0以上整数 | ドリブル | ||
| tackleFor | 0以上整数 | タックル | ||
| clearFor | 0以上整数 | クリア | ||
| interceptFor | 0以上整数 | インターセプト | ||
| offsideFor | 0以上整数 | オフサイド | ||
| yellowCardFor | 0以上整数 | 警告 | ||
| redCardFor | 0以上整数 | 退場 | ||
| entryAtk3rdFor | 0以上整数 | ATK3rd進入 | ||
| entryPenaltyAreaFor | 0以上整数 | PA進入 | ||
| distanceFor | 0以上整数 | 総移動距離 | ||
| sprintFor | 0以上整数 | スプリント | ||
| attackCountFor | 0以上整数 | 攻撃回数 | ||
| chanceCreationRateFor | 数字 | チャンス構築率 | ||
| shootSuccessRateFor | 数字 | シュート成功率 | ||
| passSuccessRateFor | 数字 | パス成功率 | ||
| crossSuccessRateFor | 数字 | クロス成功率 | ||
| throwInSuccessRateFor | 数字 | スローイン成功率 | ||
| dribbleSuccessRateFor | 数字 | ドリブル成功率 | ||
| tackleSuccessRateFor | 数字 | タックル成功率 | ||
| possession | 数字 | ボール保持率 | ||
| acc_time | 0以上整数 | プレイタイム | ||
| xgAgainst | 数字 | 失点期待値 | ||
| shootAgainst | 0以上整数 | シュート | ||
| onTargetAgainst | 0以上整数 | 枠内シュート | ||
| pkShootAgainst | 0以上整数 | PKによるシュート | ||
| passAgainst | 0以上整数 | パス | ||
| crossAgainst | 0以上整数 | クロス | ||
| directFkAgainst | 0以上整数 | 直接FK | ||
| indirectFkAgainst | 0以上整数 | 間接FK | ||
| cornerKickAgainst | 0以上整数 | CK | ||
| throwInAgainst | 0以上整数 | スローイン | ||
| dribbleAgainst | 0以上整数 | ドリブル | ||
| tackleAgainst | 0以上整数 | タックル | ||
| clearAgainst | 0以上整数 | クリア | ||
| interceptAgainst | 0以上整数 | インターセプト | ||
| offsideAgainst | 0以上整数 | オフサイド | ||
| yellowCardAgainst | 0以上整数 | 警告 | ||
| redCardAgainst | 0以上整数 | 退場 | ||
| entryAtk3rdAgainst | 0以上整数 | ATK3rd進入 | ||
| entryPenaltyAreaAgainst | 0以上整数 | PA進入 | ||
| distanceAgainst | 0以上整数 | 総移動距離 | ||
| sprintAgainst | 0以上整数 | スプリント | ||
| attackCountAgainst | 0以上整数 | 攻撃回数 | ||
| chanceCreationRateAgainst | 数字 | チャンス構築率 | ||
| shootSuccessRateAgainst | 数字 | シュート成功率 | ||
| passSuccessRateAgainst | 数字 | パス成功率 | ||
| crossSuccessRateAgainst | 数字 | クロス成功率 | ||
| throwInSuccessRateAgainst | 数字 | スローイン成功率 | ||
| dribbleSuccessRateAgainst | 数字 | ドリブル成功率 | ||
| tackleSuccessRateAgainst | 数字 | タックル成功率 |
以下の組み合わせで ユニーク とする:
matchteam
| フィールド | 型 | 日本語 | require | default |
|---|---|---|---|---|
| match | 外部キー | 試合 (Match) | true | |
| referee | 外部キー(Referee) | 審判 | ||
| referee_name | 文字列 | 審判名 | ||
| role | 文字列 | 役割 |
以下の2つの組み合わせでユニークとする:
-
match -
referee -
match -
referee_name
- referee または referee_name どちらかを入力
roleの例 主審・副審・VARなど