Add contestants
Some checks are pending
CI / scan_ruby (push) Waiting to run
CI / scan_js (push) Waiting to run
CI / lint (push) Waiting to run
CI / test (push) Waiting to run

This commit is contained in:
sto
2025-03-20 09:19:39 +01:00
parent 658c50fd04
commit 44507bb85c
18 changed files with 145 additions and 25 deletions

View File

@@ -0,0 +1,11 @@
class CreateContestants < ActiveRecord::Migration[8.0]
def change
create_table :contestants do |t|
t.string :name
t.string :email
t.belongs_to :contest, null: false, foreign_key: true
t.timestamps
end
end
end

12
db/schema.rb generated
View File

@@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[8.0].define(version: 2025_03_20_075601) do
ActiveRecord::Schema[8.0].define(version: 2025_03_20_080142) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -39,6 +39,15 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_20_075601) do
t.index ["blob_id", "variation_digest"], name: "index_active_storage_variant_records_uniqueness", unique: true
end
create_table "contestants", force: :cascade do |t|
t.string "name"
t.string "email"
t.integer "contest_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["contest_id"], name: "index_contestants_on_contest_id"
end
create_table "contests", force: :cascade do |t|
t.string "name"
t.integer "user_id", null: false
@@ -78,6 +87,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_20_075601) do
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 "contestants", "contests"
add_foreign_key "contests", "users"
add_foreign_key "puzzles", "contests"
add_foreign_key "sessions", "users"