class UpdateDocumentTemplateFileExtension < ActiveRecord::Migration[5.0]
  def up
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='account_journal_entry_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='activity_cost'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='fixed_asset_registry'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='fixed_asset_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='fr_pcg82_balance_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='fr_pcg82_profit_and_loss_statement'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='fr_pcga_balance_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='intervention_register'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='intervention_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='inventory_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='journal_entry_sheet'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='loan_registry'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='outgoing_delivery_docket'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='phytosanitary_register'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='purchases_invoice'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='sales_estimate'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='sales_invoice'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='sales_order'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='vat_register'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='outgoing_delivery_docket'"
    execute "UPDATE document_templates SET file_extension='odt' WHERE nature='purchases_invoice'"
  end

  def up
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='account_journal_entry_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='activity_cost'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='fixed_asset_registry'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='fixed_asset_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='fr_pcg82_balance_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='fr_pcg82_profit_and_loss_statement'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='fr_pcga_balance_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='intervention_register'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='intervention_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='inventory_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='journal_entry_sheet'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='loan_registry'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='outgoing_delivery_docket'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='phytosanitary_register'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='purchases_invoice'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='sales_estimate'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='sales_invoice'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='sales_order'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='vat_register'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='outgoing_delivery_docket'"
    execute "UPDATE document_templates SET file_extension='xml' WHERE nature='purchases_invoice'"
  end
end
