class CreateInvoiceDetails < ActiveRecord::Migration def change drop_table :invoice_details if table_exists? :invoice_details create_table :invoice_details do |t| t.belongs_to :sale, index: true t.string :uuid, null: false t.string :cfdi_type, limit: 1, null: false t.string :invoice_reason t.string :rfc_receptor t.datetime :generating_date t.datetime :stamping_date t.string :storing_url t.integer :status, limit: 1, default: 1 t.timestamps null: false end end end