Proceeding to work on controller for checkout
This commit is contained in:
@@ -5,7 +5,11 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
t.integer :price_cents
|
||||
t.string :status, default: "active"
|
||||
|
||||
t.references :user, null: false, foreign_key: false
|
||||
# Add names to ticket
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
|
||||
t.references :user, null: true, foreign_key: false
|
||||
t.references :ticket_type, null: false, foreign_key: false
|
||||
|
||||
t.timestamps
|
||||
@@ -14,5 +18,9 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
add_index :tickets, :qr_code, unique: true
|
||||
add_index :tickets, :user_id unless index_exists?(:tickets, :user_id)
|
||||
add_index :tickets, :ticket_type_id unless index_exists?(:tickets, :ticket_type_id)
|
||||
|
||||
# Add indexes for better performance
|
||||
# add_index :tickets, :first_name unless index_exists?(:tickets, :first_name)
|
||||
# add_index :tickets, :last_name unless index_exists?(:tickets, :last_name)
|
||||
end
|
||||
end
|
||||
|
||||
4
db/schema.rb
generated
4
db/schema.rb
generated
@@ -54,7 +54,9 @@ ActiveRecord::Schema[8.0].define(version: 2025_08_23_171354) do
|
||||
t.string "qr_code"
|
||||
t.integer "price_cents"
|
||||
t.string "status", default: "active"
|
||||
t.bigint "user_id", null: false
|
||||
t.string "first_name"
|
||||
t.string "last_name"
|
||||
t.bigint "user_id"
|
||||
t.bigint "ticket_type_id", null: false
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
|
||||
Reference in New Issue
Block a user