Add ability to follow hashtags (#18809)
This commit is contained in:
parent
ecb3bb3256
commit
c3f0621a59
18 changed files with 329 additions and 20 deletions
12
db/migrate/20220714171049_create_tag_follows.rb
Normal file
12
db/migrate/20220714171049_create_tag_follows.rb
Normal file
|
@ -0,0 +1,12 @@
|
|||
class CreateTagFollows < ActiveRecord::Migration[6.1]
|
||||
def change
|
||||
create_table :tag_follows do |t|
|
||||
t.belongs_to :tag, null: false, foreign_key: { on_delete: :cascade }
|
||||
t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }, index: false
|
||||
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :tag_follows, [:account_id, :tag_id], unique: true
|
||||
end
|
||||
end
|
13
db/schema.rb
13
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: 2022_07_10_102457) do
|
||||
ActiveRecord::Schema.define(version: 2022_07_14_171049) do
|
||||
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "plpgsql"
|
||||
|
@ -928,6 +928,15 @@ ActiveRecord::Schema.define(version: 2022_07_10_102457) do
|
|||
t.datetime "updated_at", null: false
|
||||
end
|
||||
|
||||
create_table "tag_follows", force: :cascade do |t|
|
||||
t.bigint "tag_id", null: false
|
||||
t.bigint "account_id", null: false
|
||||
t.datetime "created_at", precision: 6, null: false
|
||||
t.datetime "updated_at", precision: 6, null: false
|
||||
t.index ["account_id", "tag_id"], name: "index_tag_follows_on_account_id_and_tag_id", unique: true
|
||||
t.index ["tag_id"], name: "index_tag_follows_on_tag_id"
|
||||
end
|
||||
|
||||
create_table "tags", force: :cascade do |t|
|
||||
t.string "name", default: "", null: false
|
||||
t.datetime "created_at", null: false
|
||||
|
@ -1167,6 +1176,8 @@ ActiveRecord::Schema.define(version: 2022_07_10_102457) do
|
|||
add_foreign_key "statuses", "statuses", column: "reblog_of_id", on_delete: :cascade
|
||||
add_foreign_key "statuses_tags", "statuses", on_delete: :cascade
|
||||
add_foreign_key "statuses_tags", "tags", name: "fk_3081861e21", on_delete: :cascade
|
||||
add_foreign_key "tag_follows", "accounts", on_delete: :cascade
|
||||
add_foreign_key "tag_follows", "tags", on_delete: :cascade
|
||||
add_foreign_key "tombstones", "accounts", on_delete: :cascade
|
||||
add_foreign_key "user_invite_requests", "users", on_delete: :cascade
|
||||
add_foreign_key "users", "accounts", name: "fk_50500f500d", on_delete: :cascade
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue