Worlds Bets
This commit is contained in:
10
db/migrate/20260904063514_create_world_countries.rb
Normal file
10
db/migrate/20260904063514_create_world_countries.rb
Normal file
@@ -0,0 +1,10 @@
|
||||
class CreateWorldCountries < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :world_countries do |t|
|
||||
t.string :name, null: false
|
||||
t.string :code, null: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
14
db/migrate/20260904063926_create_world_participants.rb
Normal file
14
db/migrate/20260904063926_create_world_participants.rb
Normal file
@@ -0,0 +1,14 @@
|
||||
class CreateWorldParticipants < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :world_participants do |t|
|
||||
t.string :username, null: false
|
||||
t.string :name, null: false
|
||||
t.belongs_to :world_country, null: false, foreign_key: true
|
||||
t.integer :qualifier_result
|
||||
t.integer :semifinal_result
|
||||
t.integer :final_result
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddRoundToWorldParticipant < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :world_participants, :round, :string, null: false
|
||||
end
|
||||
end
|
||||
11
db/migrate/20260904131402_create_world_bets.rb
Normal file
11
db/migrate/20260904131402_create_world_bets.rb
Normal file
@@ -0,0 +1,11 @@
|
||||
class CreateWorldBets < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :world_bets do |t|
|
||||
t.string :name
|
||||
t.string :bet
|
||||
t.integer :score
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddScoreToWorldParticipant < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :world_participants, :score, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddWorldScoreToWorldBet < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :world_bets, :world_score, :integer
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddFrenchScoreToWorldBet < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :world_bets, :french_score, :integer
|
||||
end
|
||||
end
|
||||
34
db/schema.rb
generated
34
db/schema.rb
generated
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2026_08_25_071844) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2026_09_05_120106) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -203,6 +203,37 @@ ActiveRecord::Schema[8.0].define(version: 2026_08_25_071844) do
|
||||
t.index ["email_address"], name: "index_users_on_email_address", unique: true
|
||||
end
|
||||
|
||||
create_table "world_bets", force: :cascade do |t|
|
||||
t.string "name"
|
||||
t.string "bet"
|
||||
t.integer "score"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.integer "world_score"
|
||||
t.integer "french_score"
|
||||
end
|
||||
|
||||
create_table "world_countries", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "code", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "world_participants", force: :cascade do |t|
|
||||
t.string "username", null: false
|
||||
t.string "name", null: false
|
||||
t.integer "world_country_id", null: false
|
||||
t.integer "qualifier_result"
|
||||
t.integer "semifinal_result"
|
||||
t.integer "final_result"
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "round", null: false
|
||||
t.integer "score"
|
||||
t.index ["world_country_id"], name: "index_world_participants_on_world_country_id"
|
||||
end
|
||||
|
||||
add_foreign_key "active_storage_attachments", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id"
|
||||
add_foreign_key "categories", "contests"
|
||||
@@ -220,4 +251,5 @@ ActiveRecord::Schema[8.0].define(version: 2026_08_25_071844) do
|
||||
add_foreign_key "offlines", "contests"
|
||||
add_foreign_key "puzzles", "contests"
|
||||
add_foreign_key "sessions", "users"
|
||||
add_foreign_key "world_participants", "world_countries"
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user