class CreateContabilidadeNotasFiscais < ActiveRecord::Migration[5.2]
  def up
    create_table :contabilidade_notas_fiscais do |t|
      t.integer :liquidacao_id
      t.integer :tipo_da_nota
      t.string :numero_da_nota, limit: 15
      t.string :serie, limit: 5
      t.integer :tipo_de_emissao, limit: 2
      t.date :data_de_emissao
      t.integer :tipo_de_desconto, limit: 2
      t.decimal :valor_de_desconto, precision: 12, scale: 2
      t.date :data_limite_de_expedicao
      t.string :numero_protocolo_de_autorizacao, limit: 15
      t.string :chave_de_verificacao, limit: 50
      t.string :numero_dae, limit: 10
      t.integer :cfop_id
      t.string :serie_do_selo, limit: 2
      t.string :numero_do_selo, limit: 10
      t.string :numero_da_serie_do_selo, limit: 10
      t.string :numeros_de_formularios, limit: 255
      t.string :chave_de_acesso, limit: 44

      t.timestamps
    end
  end

  def down
    drop_table :contabilidade_notas_fiscais
  end
end
