wip: order checkout
This commit is contained in:
@@ -9,30 +9,13 @@ class CreateTickets < ActiveRecord::Migration[8.0]
|
||||
t.string :first_name
|
||||
t.string :last_name
|
||||
|
||||
# Implemented to "temporize" tickets
|
||||
# If a ticket is not paid in time, it is removed from the database
|
||||
#
|
||||
t.string :stripe_session_id
|
||||
t.timestamp :expires_at
|
||||
t.integer :payment_attempts, default: 0
|
||||
t.timestamp :last_payment_attempt_at
|
||||
|
||||
t.references :user, null: true, foreign_key: false
|
||||
t.references :ticket_type, null: false, foreign_key: false
|
||||
# Tickets belong to orders (orders handle payment logic)
|
||||
t.references :order, null: false, foreign_key: true
|
||||
t.references :ticket_type, null: false, foreign_key: true
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
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)
|
||||
#
|
||||
# add_index :tickets, :stripe_session_id, unique: true
|
||||
# add_index :tickets, [ :status, :expires_at ]
|
||||
# add_index :tickets, [ :user_id, :status ]
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user