develop #3

Merged
kbe merged 227 commits from develop into main 2025-09-16 14:35:23 +00:00
2 changed files with 12 additions and 0 deletions
Showing only changes of commit 7f4aded5aa - Show all commits

View File

@@ -13,5 +13,9 @@ class CreateTicketTypes < ActiveRecord::Migration[8.0]
t.timestamps
end
add_index :ticket_types, :party_id unless index_exists?(:ticket_types, :party_id)
add_index :ticket_types, :sale_start_at unless index_exists?(:ticket_types, :sale_start_at)
add_index :ticket_types, :sale_end_at unless index_exists?(:ticket_types, :sale_end_at)
end
end

View File

@@ -2,8 +2,16 @@ 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: 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)
end
end