change transactional primary key to custom ID for better portability

This commit is contained in:
Min Zeya Phyo
2017-06-03 19:12:35 +06:30
parent 9dddd2fc78
commit 394d2ed938
16 changed files with 52 additions and 31 deletions

View File

@@ -1,6 +1,7 @@
class CreateCustomers < ActiveRecord::Migration[5.0]
def change
create_table :customers do |t|
create_table :customers, :id => false, :primary_key => :customer_id do |t|
t.string :customer_id, :limit => 16, :null => false, :index => true, :unique => true #custom foreign_key to prevent conflict during sync
t.string :name, :null => false
t.string :company
t.string :contact_no