Add contestants
This commit is contained in:
11
db/migrate/20250320080142_create_contestants.rb
Normal file
11
db/migrate/20250320080142_create_contestants.rb
Normal 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
12
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: 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"
|
||||
|
Reference in New Issue
Block a user