Add circle posts history support (#18)

* Wip: make web backend

* Wip: keep statuses if edit circle

* Wip: Add circle history page and record circle posts

* Add circle post to history in web ui when post

* Add test
This commit is contained in:
KMY(雪あすか) 2023-09-24 13:01:09 +09:00 committed by GitHub
parent 0a42f4b7e2
commit df3b3f4185
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 544 additions and 15 deletions

View file

@ -0,0 +1,22 @@
# frozen_string_literal: true
require Rails.root.join('lib', 'mastodon', 'migration_helpers')
class CreateCircleStatuses < ActiveRecord::Migration[7.0]
include Mastodon::MigrationHelpers
disable_ddl_transaction!
def change
safety_assured do
create_table :circle_statuses do |t|
t.belongs_to :circle, null: true, foreign_key: { on_delete: :cascade }
t.belongs_to :status, null: false, foreign_key: { on_delete: :cascade }
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
add_index :circle_statuses, [:circle_id, :status_id], unique: true
end
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: 2023_09_19_232836) do
ActiveRecord::Schema[7.0].define(version: 2023_09_23_103430) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -447,6 +447,16 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_19_232836) do
t.index ["follow_id"], name: "index_circle_accounts_on_follow_id"
end
create_table "circle_statuses", force: :cascade do |t|
t.bigint "circle_id"
t.bigint "status_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["circle_id", "status_id"], name: "index_circle_statuses_on_circle_id_and_status_id", unique: true
t.index ["circle_id"], name: "index_circle_statuses_on_circle_id"
t.index ["status_id"], name: "index_circle_statuses_on_status_id"
end
create_table "circles", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "title", default: "", null: false
@ -1414,6 +1424,8 @@ ActiveRecord::Schema[7.0].define(version: 2023_09_19_232836) do
add_foreign_key "circle_accounts", "accounts", on_delete: :cascade
add_foreign_key "circle_accounts", "circles", on_delete: :cascade
add_foreign_key "circle_accounts", "follows", on_delete: :cascade
add_foreign_key "circle_statuses", "circles", on_delete: :cascade
add_foreign_key "circle_statuses", "statuses", on_delete: :cascade
add_foreign_key "circles", "accounts", on_delete: :cascade
add_foreign_key "conversation_mutes", "accounts", name: "fk_225b4212bb", on_delete: :cascade
add_foreign_key "conversation_mutes", "conversations", on_delete: :cascade