change transactional primary key to custom ID for better portability
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
class CreateOrders < ActiveRecord::Migration[5.0]
|
||||
def change
|
||||
create_table :orders do |t|
|
||||
create_table :orders, :id => false, :primary_key => :order_id do |t|
|
||||
t.string :order_id, :limit => 16, :null => false, :index => true, :unique => true #custom foreign_key to prevent conflict during sync
|
||||
t.datetime :date, :null => false
|
||||
t.string :source, :null => false, :default => "emenu"
|
||||
t.string :order_type, :null => false, :default => "dine-in"
|
||||
t.references :customer, foreign_key: true
|
||||
t.string :customer_id, foreign_key: true, :limit => 16
|
||||
t.integer :item_count, :null => false, :default => 0
|
||||
t.integer :quantity_count, :null => false, :default => 0
|
||||
t.string :status, :null => false, :default => "new"
|
||||
|
||||
Reference in New Issue
Block a user