class CreateProducts < ActiveRecord::Migration[5.1] def change create_table :dhatu_products do |t| t.string :title, :null => false, :limit=>256 t.string :sub_title, :null => false, :limit=>256 t.string :ean_sku, :limit=>256 t.string :reference_number, :limit=>256 t.references :manufacturer t.references :category t.references :top_category t.string :short_description, null: true, limit: 512 t.text :description t.decimal :price, :precision => 12, :scale => 6, default: 0.00 t.string :status, :null => false, :default=>"unpublished", :limit=>16 t.boolean :featured, default: false t.integer :priority, default: 1, null: false t.timestamps null: false end add_index :dhatu_products, :status end end