From 51638d2eb24af748149846633cd89e87886cdb35 Mon Sep 17 00:00:00 2001 From: Karina Kwiatek Date: Mon, 27 Feb 2023 21:34:34 +0100 Subject: [PATCH] Remove `subscriptions.is_active` column --- .../20230227174822_remove_is_active_from_subscriptions.rb | 8 ++++++++ db/schema.rb | 3 +-- 2 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 db/migrate/20230227174822_remove_is_active_from_subscriptions.rb diff --git a/db/migrate/20230227174822_remove_is_active_from_subscriptions.rb b/db/migrate/20230227174822_remove_is_active_from_subscriptions.rb new file mode 100644 index 00000000..3b8cb4b5 --- /dev/null +++ b/db/migrate/20230227174822_remove_is_active_from_subscriptions.rb @@ -0,0 +1,8 @@ +# frozen_string_literal: true + +class RemoveIsActiveFromSubscriptions < ActiveRecord::Migration[6.1] + def up + execute "DELETE FROM subscriptions WHERE is_active = FALSE" + remove_column :subscriptions, :is_active + end +end diff --git a/db/schema.rb b/db/schema.rb index 3cabc240..39dc6424 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 2023_02_25_143633) do +ActiveRecord::Schema.define(version: 2023_02_27_174822) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -261,7 +261,6 @@ ActiveRecord::Schema.define(version: 2023_02_25_143633) do t.bigint "answer_id", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.boolean "is_active", default: true t.index ["user_id", "answer_id"], name: "index_subscriptions_on_user_id_and_answer_id" end