diff options
author | Eugen Rochko <eugen@zeonfederated.com> | 2019-09-02 18:11:13 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-09-02 18:11:13 +0200 |
commit | 70ddef2654a931827ce5e4323e3042365f6078f2 (patch) | |
tree | 05ed40d6d1b218a5131199c88d0c9cd1fa0091a0 /db | |
parent | ac6935b629f5e9cd07cca468a6f3588a6e585e25 (diff) |
Change trending hashtags to not disappear instantly after midnight (#11712)
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20190901035623_add_max_score_to_tags.rb | 6 | ||||
-rw-r--r-- | db/post_migrate/20190901040524_remove_score_from_tags.rb | 12 | ||||
-rw-r--r-- | db/schema.rb | 6 |
3 files changed, 21 insertions, 3 deletions
diff --git a/db/migrate/20190901035623_add_max_score_to_tags.rb b/db/migrate/20190901035623_add_max_score_to_tags.rb new file mode 100644 index 000000000..f936e9871 --- /dev/null +++ b/db/migrate/20190901035623_add_max_score_to_tags.rb @@ -0,0 +1,6 @@ +class AddMaxScoreToTags < ActiveRecord::Migration[5.2] + def change + add_column :tags, :max_score, :float + add_column :tags, :max_score_at, :datetime + end +end diff --git a/db/post_migrate/20190901040524_remove_score_from_tags.rb b/db/post_migrate/20190901040524_remove_score_from_tags.rb new file mode 100644 index 000000000..a1112700b --- /dev/null +++ b/db/post_migrate/20190901040524_remove_score_from_tags.rb @@ -0,0 +1,12 @@ +# frozen_string_literal: true + +class RemoveScoreFromTags < ActiveRecord::Migration[5.2] + disable_ddl_transaction! + + def change + safety_assured do + remove_column :tags, :score, :int + remove_column :tags, :last_trend_at, :datetime + end + end +end diff --git a/db/schema.rb b/db/schema.rb index 482bca367..5576f70bf 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: 2019_08_23_221802) do +ActiveRecord::Schema.define(version: 2019_09_01_040524) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -664,14 +664,14 @@ ActiveRecord::Schema.define(version: 2019_08_23_221802) do t.string "name", default: "", null: false t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.integer "score" t.boolean "usable" t.boolean "trendable" t.boolean "listable" t.datetime "reviewed_at" t.datetime "requested_review_at" t.datetime "last_status_at" - t.datetime "last_trend_at" + t.float "max_score" + t.datetime "max_score_at" t.index "lower((name)::text)", name: "index_tags_on_name_lower", unique: true end |