Add puzzles to contests
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-15 14:28:24 +01:00
parent eca2e46d23
commit 0cbd2e4fdc
10 changed files with 63 additions and 19 deletions

View File

@@ -0,0 +1,5 @@
class AddContestRefToPuzzle < ActiveRecord::Migration[8.0]
def change
add_reference :puzzles, :contest, null: false, foreign_key: true
end
end

5
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_15_114657) do
ActiveRecord::Schema[8.0].define(version: 2025_03_15_124339) do
create_table "active_storage_attachments", force: :cascade do |t|
t.string "name", null: false
t.string "record_type", null: false
@@ -53,6 +53,8 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_15_114657) do
t.string "name"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.integer "contest_id", null: false
t.index ["contest_id"], name: "index_puzzles_on_contest_id"
end
create_table "sessions", force: :cascade do |t|
@@ -76,5 +78,6 @@ ActiveRecord::Schema[8.0].define(version: 2025_03_15_114657) 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 "contests", "users"
add_foreign_key "puzzles", "contests"
add_foreign_key "sessions", "users"
end