instalar groupdate
This commit is contained in:
parent
2e8a75e97e
commit
eb290338b5
3 changed files with 18 additions and 0 deletions
3
.gitmodules
vendored
Normal file
3
.gitmodules
vendored
Normal file
|
@ -0,0 +1,3 @@
|
|||
[submodule "db/groupdate"]
|
||||
path = db/groupdate
|
||||
url = https://github.com/ankane/groupdate.sql
|
1
db/groupdate
Submodule
1
db/groupdate
Submodule
|
@ -0,0 +1 @@
|
|||
Subproject commit e8eaa5b42d9e0ccd1628240a8b86ceb975ed4205
|
14
db/migrate/20220324131233_groupdate.rb
Normal file
14
db/migrate/20220324131233_groupdate.rb
Normal file
|
@ -0,0 +1,14 @@
|
|||
# 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
|
Loading…
Reference in a new issue