class CreatePProducts < ActiveRecord::Migration[6.0]
  def change
    create_table :p_products do |t|
      t.string       :name
      t.decimal      :ct_price_ht,   :precision => 14,   :scale => 2
      t.decimal      :ct_purchase_price_ht,   :precision => 14,   :scale => 2
      t.references   :p_product_cat,   index: true
      t.string       :code
      t.string       :sub_code
      t.string       :conditionnement
      t.string       :uv
      t.boolean      :tgap,   :default => false
      t.boolean      :fisc,   :default => false
      t.string       :un
      t.decimal      :capacite,   :precision => 14,   :scale => 2
      t.boolean      :enabled,   :default => true
      
      t.references   :s_brand
      
      t.boolean :discount_enrobage, :default => false

      t.timestamps
    end
  end
end
