Add offline model and "new" form/controller
This commit is contained in:
		
							
								
								
									
										10
									
								
								db/migrate/20251029155116_create_offlines.rb
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										10
									
								
								db/migrate/20251029155116_create_offlines.rb
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,10 @@ | ||||
| class CreateOfflines < ActiveRecord::Migration[8.0] | ||||
|   def change | ||||
|     create_table :offlines do |t| | ||||
|       t.timestamps | ||||
|       t.belongs_to :contest, null: false, foreign_key: true | ||||
|       t.datetime :start_time, null: false | ||||
|       t.datetime :end_time | ||||
|     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_10_28_131431) do | ||||
| ActiveRecord::Schema[8.0].define(version: 2025_10_29_155116) do | ||||
|   create_table "active_storage_attachments", force: :cascade do |t| | ||||
|     t.string "name", null: false | ||||
|     t.string "record_type", null: false | ||||
| @@ -125,6 +125,15 @@ ActiveRecord::Schema[8.0].define(version: 2025_10_28_131431) do | ||||
|     t.index ["contest_id"], name: "index_messages_on_contest_id" | ||||
|   end | ||||
|  | ||||
|   create_table "offlines", force: :cascade do |t| | ||||
|     t.datetime "created_at", null: false | ||||
|     t.datetime "updated_at", null: false | ||||
|     t.integer "contest_id", null: false | ||||
|     t.datetime "start_time", null: false | ||||
|     t.datetime "end_time" | ||||
|     t.index ["contest_id"], name: "index_offlines_on_contest_id" | ||||
|   end | ||||
|  | ||||
|   create_table "puzzles", force: :cascade do |t| | ||||
|     t.string "name" | ||||
|     t.datetime "created_at", null: false | ||||
| @@ -165,6 +174,7 @@ ActiveRecord::Schema[8.0].define(version: 2025_10_28_131431) do | ||||
|   add_foreign_key "contestants", "contests" | ||||
|   add_foreign_key "contests", "users" | ||||
|   add_foreign_key "messages", "contests" | ||||
|   add_foreign_key "offlines", "contests" | ||||
|   add_foreign_key "puzzles", "contests" | ||||
|   add_foreign_key "sessions", "users" | ||||
| end | ||||
|   | ||||
		Reference in New Issue
	
	Block a user