Change hashtag trends to be stored in the database instead of redis (#32837)
Co-authored-by: David Roetzel <david@roetzel.de>
This commit is contained in:
parent
b9b26490e7
commit
48ea7552dd
18 changed files with 195 additions and 157 deletions
15
db/migrate/20241111141355_create_tag_trends.rb
Normal file
15
db/migrate/20241111141355_create_tag_trends.rb
Normal file
|
@ -0,0 +1,15 @@
|
|||
# frozen_string_literal: true
|
||||
|
||||
class CreateTagTrends < ActiveRecord::Migration[7.2]
|
||||
def change
|
||||
create_table :tag_trends do |t| # rubocop:disable Rails/CreateTableWithTimestamps
|
||||
t.references :tag, null: false, foreign_key: { on_delete: :cascade }, index: false
|
||||
t.float :score, null: false, default: 0
|
||||
t.integer :rank, null: false, default: 0
|
||||
t.boolean :allowed, null: false, default: false
|
||||
t.string :language, null: false, default: ''
|
||||
end
|
||||
|
||||
add_index :tag_trends, [:tag_id, :language], unique: true
|
||||
end
|
||||
end
|
Loading…
Add table
Add a link
Reference in a new issue