From 094a8092de7721edab16cfb052db058dbe3464cd Mon Sep 17 00:00:00 2001 From: f Date: Fri, 3 Sep 2021 15:23:11 -0300 Subject: [PATCH] Agregar rollups --- Gemfile | 1 + Gemfile.lock | 10 +++++++++- db/migrate/20210807003928_create_rollups.rb | 15 +++++++++++++++ 3 files changed, 25 insertions(+), 1 deletion(-) create mode 100644 db/migrate/20210807003928_create_rollups.rb diff --git a/Gemfile b/Gemfile index 4256e307..2f5446a0 100644 --- a/Gemfile +++ b/Gemfile @@ -58,6 +58,7 @@ gem 'rails-i18n' gem 'rails_warden' gem 'redis', require: %w[redis redis/connection/hiredis] gem 'redis-rails' +gem 'rollups' gem 'rubyzip' gem 'rugged' gem 'concurrent-ruby-ext' diff --git a/Gemfile.lock b/Gemfile.lock index 33fba3a0..6c873d9b 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -205,6 +205,8 @@ GEM ffi (~> 1.0) globalid (0.4.2) activesupport (>= 4.2.0) + groupdate (5.2.2) + activesupport (>= 5) hairtrigger (0.2.24) activerecord (>= 5.0, < 7) ruby2ruby (~> 2.4) @@ -345,6 +347,7 @@ GEM mini_histogram (0.3.1) mini_magick (4.11.0) mini_mime (1.1.0) + mini_portile2 (2.5.3) minima (2.5.1) jekyll (>= 3.5, < 5.0) jekyll-feed (~> 0.9) @@ -357,7 +360,8 @@ GEM net-ssh (6.1.0) netaddr (2.0.4) nio4r (2.5.7-x86_64-linux-musl) - nokogiri (1.11.7-x86_64-linux) + nokogiri (1.11.7-x86_64-linux-musl) + mini_portile2 (~> 2.5.0) racc (~> 1.4) orm_adapter (0.5.0) parallel (1.20.1) @@ -479,6 +483,9 @@ GEM actionpack (>= 5.0) railties (>= 5.0) rexml (3.2.5) + rollups (0.1.2) + activesupport (>= 5.1) + groupdate (>= 5.2) rouge (3.26.0) rubocop (1.18.3) parallel (~> 1.10) @@ -692,6 +699,7 @@ DEPENDENCIES recursero-jekyll-theme redis redis-rails + rollups rubocop-rails rubyzip rugged diff --git a/db/migrate/20210807003928_create_rollups.rb b/db/migrate/20210807003928_create_rollups.rb new file mode 100644 index 00000000..932513a4 --- /dev/null +++ b/db/migrate/20210807003928_create_rollups.rb @@ -0,0 +1,15 @@ +# frozen_string_literal: true + +# Crear la tabla de Rollups +class CreateRollups < ActiveRecord::Migration[6.1] + def change + create_table :rollups do |t| + t.string :name, null: false + t.string :interval, null: false + t.datetime :time, null: false + t.jsonb :dimensions, null: false, default: {} + t.float :value + end + add_index :rollups, %i[name interval time dimensions], unique: true + end +end