class CreateStockBlocks < ActiveRecord::Migration[6.0]
  def change
    create_table :stock_blocks do |t|
      t.date :enter_date
      t.string :ref
      t.integer :p_fournisseur_order_id
      t.integer :p_customer_sheet_id
      t.integer :s_module_id
      t.integer :s_project_id

      t.decimal :cc_price_tot_ht
      t.decimal :ac_price_tot_ht
      
      t.integer :stockable_id
      t.string :stockable_type
      
      t.integer :admin_id
      
      t.string :movement_type, :default => "cred"
      t.boolean :accounting, :default => false

      t.timestamps
    end
  end
end
