From 416d42e9491885e8f5f9299f303e8f1bbcd737d2 Mon Sep 17 00:00:00 2001 From: fef Date: Thu, 24 Nov 2022 10:33:50 +0000 Subject: [PATCH] Revert "add emoji reaction database model" I didn't intend to commit this to main and it's kind of a work in progress anyway. This reverts commit 0da3340f0d1c7257e8398bd339fddb2f78a5220f. --- app/models/emoji_reaction.rb | 16 ------------ app/models/status.rb | 1 - .../20221123004534_create_emoji_reactions.rb | 11 -------- db/schema.rb | 26 +------------------ spec/fabricators/emoji_reaction_fabricator.rb | 5 ---- spec/models/emoji_reaction_spec.rb | 5 ---- 6 files changed, 1 insertion(+), 63 deletions(-) delete mode 100644 app/models/emoji_reaction.rb delete mode 100644 db/migrate/20221123004534_create_emoji_reactions.rb delete mode 100644 spec/fabricators/emoji_reaction_fabricator.rb delete mode 100644 spec/models/emoji_reaction_spec.rb diff --git a/app/models/emoji_reaction.rb b/app/models/emoji_reaction.rb deleted file mode 100644 index 4ffabc76f2..0000000000 --- a/app/models/emoji_reaction.rb +++ /dev/null @@ -1,16 +0,0 @@ -# frozen_string_literal: true -# == Schema Information -# -# Table name: emoji_reactions -# -# id :bigint(8) not null, primary key -# emoji :string -# status_id :bigint(8) not null -# account_id :bigint(8) not null -# created_at :datetime not null -# updated_at :datetime not null -# -class EmojiReaction < ApplicationRecord - belongs_to :status - belongs_to :account -end diff --git a/app/models/status.rb b/app/models/status.rb index 5c81fb8e2d..044816be76 100644 --- a/app/models/status.rb +++ b/app/models/status.rb @@ -70,7 +70,6 @@ class Status < ApplicationRecord has_many :mentions, dependent: :destroy, inverse_of: :status has_many :active_mentions, -> { active }, class_name: 'Mention', inverse_of: :status has_many :media_attachments, dependent: :nullify - has_many :emoji_reactions has_and_belongs_to_many :tags has_and_belongs_to_many :preview_cards diff --git a/db/migrate/20221123004534_create_emoji_reactions.rb b/db/migrate/20221123004534_create_emoji_reactions.rb deleted file mode 100644 index d013ecca28..0000000000 --- a/db/migrate/20221123004534_create_emoji_reactions.rb +++ /dev/null @@ -1,11 +0,0 @@ -class CreateEmojiReactions < ActiveRecord::Migration[6.1] - def change - create_table :emoji_reactions do |t| - t.string :emoji - t.references :status, null: false, foreign_key: true - t.references :account, null: false, foreign_key: true - - t.timestamps - end - end -end diff --git a/db/schema.rb b/db/schema.rb index c4c483e7e9..01a95c0f29 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: 2022_11_23_004534) do +ActiveRecord::Schema.define(version: 2022_11_04_133904) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -411,16 +411,6 @@ ActiveRecord::Schema.define(version: 2022_11_23_004534) do t.index ["domain"], name: "index_email_domain_blocks_on_domain", unique: true end - create_table "emoji_reactions", force: :cascade do |t| - t.string "emoji" - t.bigint "status_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"], name: "index_emoji_reactions_on_account_id" - t.index ["status_id"], name: "index_emoji_reactions_on_status_id" - end - create_table "encrypted_messages", id: :bigint, default: -> { "timestamp_id('encrypted_messages'::text)" }, force: :cascade do |t| t.bigint "device_id" t.bigint "from_account_id" @@ -791,16 +781,6 @@ ActiveRecord::Schema.define(version: 2022_11_23_004534) do t.index ["status_id", "preview_card_id"], name: "index_preview_cards_statuses_on_status_id_and_preview_card_id" end - create_table "reactions", force: :cascade do |t| - t.string "emoji" - t.bigint "status_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"], name: "index_reactions_on_account_id" - t.index ["status_id"], name: "index_reactions_on_status_id" - end - create_table "relays", force: :cascade do |t| t.string "inbox_url", default: "", null: false t.string "follow_activity_id" @@ -1178,8 +1158,6 @@ ActiveRecord::Schema.define(version: 2022_11_23_004534) do add_foreign_key "devices", "accounts", on_delete: :cascade add_foreign_key "devices", "oauth_access_tokens", column: "access_token_id", on_delete: :cascade add_foreign_key "email_domain_blocks", "email_domain_blocks", column: "parent_id", on_delete: :cascade - add_foreign_key "emoji_reactions", "accounts" - add_foreign_key "emoji_reactions", "statuses" add_foreign_key "encrypted_messages", "accounts", column: "from_account_id", on_delete: :cascade add_foreign_key "encrypted_messages", "devices", on_delete: :cascade add_foreign_key "favourites", "accounts", name: "fk_5eb6c2b873", on_delete: :cascade @@ -1220,8 +1198,6 @@ ActiveRecord::Schema.define(version: 2022_11_23_004534) do add_foreign_key "polls", "accounts", on_delete: :cascade add_foreign_key "polls", "statuses", on_delete: :cascade add_foreign_key "preview_card_trends", "preview_cards", on_delete: :cascade - add_foreign_key "reactions", "accounts" - add_foreign_key "reactions", "statuses" add_foreign_key "report_notes", "accounts", on_delete: :cascade add_foreign_key "report_notes", "reports", on_delete: :cascade add_foreign_key "reports", "accounts", column: "action_taken_by_account_id", name: "fk_bca45b75fd", on_delete: :nullify diff --git a/spec/fabricators/emoji_reaction_fabricator.rb b/spec/fabricators/emoji_reaction_fabricator.rb deleted file mode 100644 index b7dc4d61a4..0000000000 --- a/spec/fabricators/emoji_reaction_fabricator.rb +++ /dev/null @@ -1,5 +0,0 @@ -Fabricator(:emoji_reaction) do - emoji "MyString" - status nil - account nil -end \ No newline at end of file diff --git a/spec/models/emoji_reaction_spec.rb b/spec/models/emoji_reaction_spec.rb deleted file mode 100644 index e4ff8a6c17..0000000000 --- a/spec/models/emoji_reaction_spec.rb +++ /dev/null @@ -1,5 +0,0 @@ -require 'rails_helper' - -RSpec.describe EmojiReaction, type: :model do - pending "add some examples to (or delete) #{__FILE__}" -end