ectomobile/db/migrate/20220324131233_groupdate.rb

15 lines
507 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
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'install.sql')).sub(/(BEGIN|COMMIT);/, ''
ActiveRecord::Base.connection.execute(groupdate)
end
def down
groupdate = File.read(Rails.root.join('db', 'groupdate', 'postgresql', 'uninstall.sql')).sub(/(BEGIN|COMMIT);/, ''
ActiveRecord::Base.connection.execute(groupdate)
end
end