Files
sx-fc/db/migrate/20180406080240_create_order_reservations.rb
2018-09-07 15:05:44 +06:30

36 lines
1.5 KiB
Ruby

class CreateOrderReservations < ActiveRecord::Migration[5.1]
def change
create_table :order_reservations, :id => false do |t|
t.string :order_reservation_id, :limit => 16, :primary_key => true
t.string :order_reservation_type, :null => false
t.string :customer_id, :null => false
t.datetime :requested_time, :null => false
t.datetime :pickup_time, :null => false
t.string :callback_url, :null => false
t.string :transaction_ref, :null => false
t.string :sale_id
t.integer :item_count, :null => false, :default => 0
t.integer :total_customer
t.string :payment_type
t.string :payment_status
t.string :payment_ref
t.json :taxes
t.decimal :total_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :total_tax, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :discount_amount, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :convenience_charge, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :grand_total, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.decimal :transaction_fee, :precision => 10, :scale => 2, :null => false, :default => 0.00
t.string :status, :null => false, :default => "new"
t.string :order_remark
t.string :remark
t.json :action_times
t.timestamps
end
end
def down
drop_table :order_reservations
end
end