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 , :organization_id
55- add_index :players , :riot_puuid , unique : true
56- add_index :players , :summoner_name
57- add_index :players , :status
58- add_index :players , :role
59- end
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
6059end
0 commit comments