15 lines
509 B
Ruby
15 lines
509 B
Ruby
# 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
|