houdini/db/migrate/20210122203303_create_ticket_purchases.rb
2021-02-04 10:58:38 -06:00

17 lines
588 B
Ruby

class CreateTicketPurchases < ActiveRecord::Migration[6.1]
def change
create_table :ticket_purchases, id: :string do |t|
t.integer :amount
t.integer :original_discount, default: 0
t.references :event_discount, foreign_key: true
t.references :event, foreign_key: true
t.timestamps
end
create_table :transaction_assignments, id: :string do |t|
t.references :transaction, foreign_key: true, type: :string, null: false
t.references :assignable, polymorphic: true, type: :string, index: { unique: true }, null: false
end
end
end