class CreateProductOrderDocuments < ActiveRecord::Migration
  def change
    create_table :product_order_documents do |t|
      t.string :d_number
      t.integer :d_index
      t.integer :d_year
      t.string :d_prefix
      t.string :label
      t.text :header
      t.text :footer
      t.integer :image_file_id
      t.integer :data_file_id
      t.references :product_order, index: true
      t.references :product_order_document_type
      t.integer :reseaux_id
      t.integer :fournisseur_id
      t.string :token

      t.timestamps null: false
    end
    add_foreign_key :product_order_documents, :product_orders
  end
end
