Class: CreateOrders

Inherits:
ActiveRecord::Migration
  • Object
show all
Defined in:
lib/generators/shopqi_app_webhook/templates/db/migrate/create_orders.rb

Instance Method Summary collapse

Instance Method Details

#changeObject



2
3
4
5
6
7
8
9
10
11
12
13
14
15
# File 'lib/generators/shopqi_app_webhook/templates/db/migrate/create_orders.rb', line 2

def change
  create_table :orders do |t|
    t.references :shop               , null: false
    t.integer :order_id              , null: false, unique: true
    t.string :name                   , null: false, limit: 32
    t.string :financial_status       , null: false, limit: 16
    t.string :financial_status_name  , null: false, limit: 32
    t.string :fulfillment_status     , null: false, limit: 16
    t.string :fulfillment_status_name, null: false, limit: 32
    t.float :total_price             , null: false
    t.datetime :created_at           , null: false
  end
  add_index :orders, :order_id, unique: true
end