Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com> This commit refactors the entire application to replace the 'parties' concept with 'events'. All controllers, models, views, and related files have been updated to reflect this change. The parties table has been replaced with an events table, and all related functionality has been updated accordingly.
19 lines
564 B
Ruby
Executable File
19 lines
564 B
Ruby
Executable File
class CreateTickets < ActiveRecord::Migration[8.0]
|
|
def change
|
|
create_table :tickets do |t|
|
|
t.string :qr_code
|
|
t.integer :price_cents
|
|
t.string :status, default: "active"
|
|
|
|
t.references :user, null: false, foreign_key: false
|
|
t.references :ticket_type, null: false, foreign_key: false
|
|
|
|
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)
|
|
end
|
|
end
|