From 22742cf058cef5ebf2d562b4e91ee6da2abe833f Mon Sep 17 00:00:00 2001 From: f Date: Sat, 23 Apr 2022 15:06:55 -0300 Subject: [PATCH] migraciones faltantes --- db/migrate/20211022224008_add_site_to_stats.rb | 8 ++++++++ db/migrate/20211022225449_add_name_to_stats.rb | 9 +++++++++ 2 files changed, 17 insertions(+) create mode 100644 db/migrate/20211022224008_add_site_to_stats.rb create mode 100644 db/migrate/20211022225449_add_name_to_stats.rb diff --git a/db/migrate/20211022224008_add_site_to_stats.rb b/db/migrate/20211022224008_add_site_to_stats.rb new file mode 100644 index 00000000..db2b43ab --- /dev/null +++ b/db/migrate/20211022224008_add_site_to_stats.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +# La recolección de estadísticas podría pertenecer a un sitio +class AddSiteToStats < ActiveRecord::Migration[6.1] + def change + add_belongs_to :stats, :site, index: true, null: true + end +end diff --git a/db/migrate/20211022225449_add_name_to_stats.rb b/db/migrate/20211022225449_add_name_to_stats.rb new file mode 100644 index 00000000..89a17ee0 --- /dev/null +++ b/db/migrate/20211022225449_add_name_to_stats.rb @@ -0,0 +1,9 @@ +# frozen_string_literal: true + +# Agregarle un nombre a la estadística +class AddNameToStats < ActiveRecord::Migration[6.1] + def change + add_column :stats, :name, :string, null: false + add_index :stats, :name, using: 'hash' + end +end