1- class CreatePlayers < ActiveRecord ::Migration [ 7.1 ]
2- def change
3- create_table :players , id : :uuid do |t |
4- t . references :organization , null : false , foreign_key : true , type : :uuid
5- t . string :summoner_name , null : false
6- t . string :real_name
7- t . string :role , null : false
8- t . string :country
9- t . date :birth_date
10- t . string :status , default : 'active'
11-
12- # Riot Games Data
13- t . string :riot_puuid
14- t . string :riot_summoner_id
15- t . string :riot_account_id
16- t . integer :profile_icon_id
17- t . integer :summoner_level
18-
19- # Ranked Data
20- t . string :solo_queue_tier
21- t . string :solo_queue_rank
22- t . integer :solo_queue_lp
23- t . integer :solo_queue_wins
24- t . integer :solo_queue_losses
25- t . string :flex_queue_tier
26- t . string :flex_queue_rank
27- t . integer :flex_queue_lp
28- t . string :peak_tier
29- t . string :peak_rank
30- t . string :peak_season
31-
32- # Contract Info
33- t . date :contract_start_date
34- t . date :contract_end_date
35- t . decimal :salary , precision : 10 , scale : 2
36- t . integer :jersey_number
37-
38- # Additional Info
39- t . text :champion_pool , array : true , default : [ ]
40- t . string :preferred_role_secondary
41- t . text :playstyle_tags , array : true , default : [ ]
42- t . string :twitter_handle
43- t . string :twitch_channel
44- t . string :instagram_handle
45- t . text :notes
46-
47- # Metadata
48- t . jsonb :metadata , default : { }
49- t . timestamp :last_sync_at
50-
51- t . timestamps
52- end
53-
54- add_index :players , :riot_puuid , unique : true
55- add_index :players , :summoner_name
56- add_index :players , :status
57- add_index :players , :role
58- end
59- end
1+ # frozen_string_literal: true
2+
3+ class CreatePlayers < ActiveRecord ::Migration [ 7.1 ]
4+ def change
5+ create_table :players , id : :uuid do |t |
6+ t . references :organization , null : false , foreign_key : true , type : :uuid
7+ t . string :summoner_name , null : false
8+ t . string :real_name
9+ t . string :role , null : false
10+ t . string :country
11+ t . date :birth_date
12+ t . string :status , default : 'active'
13+
14+ # Riot Games Data
15+ t . string :riot_puuid
16+ t . string :riot_summoner_id
17+ t . string :riot_account_id
18+ t . integer :profile_icon_id
19+ t . integer :summoner_level
20+
21+ # Ranked Data
22+ t . string :solo_queue_tier
23+ t . string :solo_queue_rank
24+ t . integer :solo_queue_lp
25+ t . integer :solo_queue_wins
26+ t . integer :solo_queue_losses
27+ t . string :flex_queue_tier
28+ t . string :flex_queue_rank
29+ t . integer :flex_queue_lp
30+ t . string :peak_tier
31+ t . string :peak_rank
32+ t . string :peak_season
33+
34+ # Contract Info
35+ t . date :contract_start_date
36+ t . date :contract_end_date
37+ t . decimal :salary , precision : 10 , scale : 2
38+ t . integer :jersey_number
39+
40+ # Additional Info
41+ t . text :champion_pool , array : true , default : [ ]
42+ t . string :preferred_role_secondary
43+ t . text :playstyle_tags , array : true , default : [ ]
44+ t . string :twitter_handle
45+ t . string :twitch_channel
46+ t . string :instagram_handle
47+ t . text :notes
48+
49+ # Metadata
50+ t . jsonb :metadata , default : { }
51+ t . timestamp :last_sync_at
52+
53+ t . timestamps
54+ end
55+
56+ add_index :players , :riot_puuid , unique : true
57+ add_index :players , :summoner_name
58+ add_index :players , :status
59+ add_index :players , :role
60+ end
61+ end
0 commit comments