hyoshida/comable

View on GitHub
core/db/migrate/20140502060116_create_comable_stocks.rb

Summary

Maintainability
A
0 mins
Test Coverage
class CreateComableStocks < ActiveRecord::Migration
  def change
    create_table :comable_stocks do |t|
      t.references :product, null: false
      t.string :code, null: false
      t.integer :quantity, null: false, default: 0
      t.string :sku_h_choice_name
      t.string :sku_v_choice_name
      t.timestamps null: false
    end

    add_index :comable_stocks, :code, unique: true
  end
end