Drop tables related to HtmlVariant tracking, ignore HtmlVariant.success_rate column (#18615)

* Removed code related to tracking html_variants

* Remove code related to HtmlVariant#find_for_test

* Remove spec for HtmlVariant#success_rate

* Ignore html_variants.success_rate

* Drop tables related to HtmlVariant tracking
This commit is contained in:
Anna Buianova 2022-10-26 14:46:02 +03:00 committed by GitHub
parent c8ee0f0c42
commit c60b41f025
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 15 additions and 23 deletions

View file

@ -1,4 +1,6 @@
class HtmlVariant < ApplicationRecord
self.ignored_columns = %w[success_rate].freeze
resourcify
GROUP_NAMES = %w[article_show_below_article_cta badge_landing_page campaign].freeze

View file

@ -0,0 +1,12 @@
class DropHtmlVariantTrackingTables < ActiveRecord::Migration[7.0]
def up
safety_assured do
drop_table :html_variant_trials
drop_table :html_variant_successes
end
end
def down
raise ActiveRecord::IrreversibleMigratione
end
end

View file

@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.
ActiveRecord::Schema[7.0].define(version: 2022_10_03_103855) do
ActiveRecord::Schema[7.0].define(version: 2022_10_20_120850) do
# These are extensions that must be enabled in order to support this database
enable_extension "citext"
enable_extension "pg_stat_statements"
@ -580,22 +580,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_10_03_103855) do
t.index ["url"], name: "index_github_repos_on_url", unique: true
end
create_table "html_variant_successes", force: :cascade do |t|
t.bigint "article_id"
t.datetime "created_at", precision: nil, null: false
t.bigint "html_variant_id"
t.datetime "updated_at", precision: nil, null: false
t.index ["html_variant_id", "article_id"], name: "index_html_variant_successes_on_html_variant_id_and_article_id"
end
create_table "html_variant_trials", force: :cascade do |t|
t.bigint "article_id"
t.datetime "created_at", precision: nil, null: false
t.bigint "html_variant_id"
t.datetime "updated_at", precision: nil, null: false
t.index ["html_variant_id", "article_id"], name: "index_html_variant_trials_on_html_variant_id_and_article_id"
end
create_table "html_variants", force: :cascade do |t|
t.boolean "approved", default: false
t.datetime "created_at", precision: nil, null: false
@ -1381,10 +1365,6 @@ ActiveRecord::Schema[7.0].define(version: 2022_10_03_103855) do
add_foreign_key "feedback_messages", "users", column: "offender_id", on_delete: :nullify
add_foreign_key "feedback_messages", "users", column: "reporter_id", on_delete: :nullify
add_foreign_key "github_repos", "users", on_delete: :cascade
add_foreign_key "html_variant_successes", "articles", on_delete: :nullify
add_foreign_key "html_variant_successes", "html_variants", on_delete: :cascade
add_foreign_key "html_variant_trials", "articles", on_delete: :nullify
add_foreign_key "html_variant_trials", "html_variants", on_delete: :cascade
add_foreign_key "html_variants", "users", on_delete: :cascade
add_foreign_key "identities", "users", on_delete: :cascade
add_foreign_key "mentions", "users", on_delete: :cascade

View file

@ -412,7 +412,6 @@ seeder.create_if_none(HtmlVariant) do
name: rand(100).to_s,
group: "badge_landing_page",
html: rand(1000).to_s,
success_rate: 0,
published: true,
approved: true,
user_id: User.first.id,

View file

@ -3,7 +3,6 @@ FactoryBot.define do
user
name { Faker::Hipster.paragraph(sentence_count: 1) }
html { "<div>#{rand(10_000_000_000)}</div><h1>HEllo</h1>" }
success_rate { 0.3 }
group { "article_show_below_article_cta" }
end
end