Events: initial implementation
This commit is contained in:
7
db/migrate/20260725121740_create_events.rb
Normal file
7
db/migrate/20260725121740_create_events.rb
Normal file
@@ -0,0 +1,7 @@
|
||||
class CreateEvents < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :events do |t|
|
||||
t.timestamps
|
||||
end
|
||||
end
|
||||
end
|
||||
5
db/migrate/20260725122117_add_name_to_event.rb
Normal file
5
db/migrate/20260725122117_add_name_to_event.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddNameToEvent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :events, :name, :string
|
||||
end
|
||||
end
|
||||
5
db/migrate/20260725122358_add_event_to_contest.rb
Normal file
5
db/migrate/20260725122358_add_event_to_contest.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddEventToContest < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_reference :contests, :event, foreign_key: true
|
||||
end
|
||||
end
|
||||
5
db/migrate/20260725122559_add_user_to_event.rb
Normal file
5
db/migrate/20260725122559_add_user_to_event.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddUserToEvent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_reference :events, :user, null: false, foreign_key: true
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,5 @@
|
||||
class AddSharedScoreboardToEvent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :events, :shared_scoreboard, :boolean
|
||||
end
|
||||
end
|
||||
5
db/migrate/20260726114604_add_lang_to_event.rb
Normal file
5
db/migrate/20260726114604_add_lang_to_event.rb
Normal file
@@ -0,0 +1,5 @@
|
||||
class AddLangToEvent < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
add_column :events, :lang, :string, default: 'en'
|
||||
end
|
||||
end
|
||||
19
db/schema.rb
generated
19
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_04_24_091108) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2026_07_26_114604) do
|
||||
create_table "active_storage_attachments", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -83,7 +83,6 @@ ActiveRecord::Schema[8.0].define(version: 2026_04_24_091108) do
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "display_time"
|
||||
t.integer "time_seconds"
|
||||
t.string "projected_time"
|
||||
t.string "qrcode"
|
||||
t.index ["contest_id"], name: "index_contestants_on_contest_id"
|
||||
end
|
||||
@@ -106,7 +105,9 @@ ActiveRecord::Schema[8.0].define(version: 2026_04_24_091108) do
|
||||
t.datetime "start_time"
|
||||
t.datetime "pause_time"
|
||||
t.boolean "show_stopwatch"
|
||||
t.string "organizer_form"
|
||||
t.boolean "organizer_form"
|
||||
t.integer "event_id"
|
||||
t.index ["event_id"], name: "index_contests_on_event_id"
|
||||
t.index ["slug"], name: "index_contests_on_slug", unique: true
|
||||
t.index ["user_id"], name: "index_contests_on_user_id"
|
||||
end
|
||||
@@ -118,6 +119,16 @@ ActiveRecord::Schema[8.0].define(version: 2026_04_24_091108) do
|
||||
t.string "content", null: false
|
||||
end
|
||||
|
||||
create_table "events", force: :cascade do |t|
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.string "name"
|
||||
t.integer "user_id", null: false
|
||||
t.boolean "shared_scoreboard"
|
||||
t.string "lang", default: "en"
|
||||
t.index ["user_id"], name: "index_events_on_user_id"
|
||||
end
|
||||
|
||||
create_table "friendly_id_slugs", force: :cascade do |t|
|
||||
t.string "slug", null: false
|
||||
t.integer "sluggable_id", null: false
|
||||
@@ -198,7 +209,9 @@ ActiveRecord::Schema[8.0].define(version: 2026_04_24_091108) do
|
||||
add_foreign_key "completions", "messages"
|
||||
add_foreign_key "completions", "puzzles"
|
||||
add_foreign_key "contestants", "contests"
|
||||
add_foreign_key "contests", "events"
|
||||
add_foreign_key "contests", "users"
|
||||
add_foreign_key "events", "users"
|
||||
add_foreign_key "messages", "contests"
|
||||
add_foreign_key "offlines", "completions"
|
||||
add_foreign_key "offlines", "contestants"
|
||||
|
||||
Reference in New Issue
Block a user