ectomobile/db/migrate/20220324131233_groupdate.rb

15 lines
509 B
Ruby
Raw Normal View History

2022-03-24 13:22:29 +00:00
# frozen_string_literal: true
# Instala las funciones de agrupamiento por fecha
class Groupdate < ActiveRecord::Migration[6.1]
def up
2022-03-24 13:29:41 +00:00
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'install.sql')).sub(/(BEGIN|COMMIT);/, '')
2022-03-24 13:22:29 +00:00
ActiveRecord::Base.connection.execute(groupdate)
end
def down
2022-03-24 13:29:41 +00:00
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'uninstall.sql')).sub(/(BEGIN|COMMIT);/, '')
2022-03-24 13:22:29 +00:00
ActiveRecord::Base.connection.execute(groupdate)
end
end