From f3ff407ba0b342c65a92c1c1e3914575f101adaf Mon Sep 17 00:00:00 2001 From: mgabdev <> Date: Wed, 5 Aug 2020 23:01:37 -0500 Subject: [PATCH] Added migration for adding slug, is_private, is_visible, tags, category to group MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Added: - migration for adding slug, is_private, is_visible, tags, category to group --- .../20200801023407_add_columns_to_groups.rb | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 db/migrate/20200801023407_add_columns_to_groups.rb diff --git a/db/migrate/20200801023407_add_columns_to_groups.rb b/db/migrate/20200801023407_add_columns_to_groups.rb new file mode 100644 index 00000000..a5887a13 --- /dev/null +++ b/db/migrate/20200801023407_add_columns_to_groups.rb @@ -0,0 +1,19 @@ +class AddColumnsToGroups < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def change + add_column :groups, :slug, :text + add_column :groups, :is_private, :boolean + add_column :groups, :is_visible, :boolean + add_column :groups, :tags, :string, array: true + + add_reference :groups, :group_categories, index: false + add_index :groups, :group_categories_id, algorithm: :concurrently + + change_column_default :groups, :is_private, false + change_column_default :groups, :is_visible, true + change_column_default :groups, :tags, [] + + add_index :groups, :slug, unique: true, algorithm: :concurrently + end +end \ No newline at end of file