Add circle editor

This commit is contained in:
KMY 2023-08-21 16:37:35 +09:00
parent c97e63bb18
commit b0854b1dd8
33 changed files with 1671 additions and 31 deletions

View file

@ -0,0 +1,21 @@
# frozen_string_literal: true
class CreateCircles < ActiveRecord::Migration[7.0]
def change
create_table :circles do |t|
t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }
t.string :title, null: false, default: ''
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
create_table :circle_accounts do |t|
t.belongs_to :circle, null: true, foreign_key: { on_delete: :cascade }
t.belongs_to :account, null: false, foreign_key: { on_delete: :cascade }
t.belongs_to :follow, null: false, foreign_key: { on_delete: :cascade }
t.datetime :created_at, null: false
t.datetime :updated_at, null: false
end
add_index :circle_accounts, [:circle_id, :account_id], unique: true
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_08_19_084858) do
ActiveRecord::Schema[7.0].define(version: 2023_08_21_061713) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -401,6 +401,26 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_19_084858) do
t.index ["reference_account_id"], name: "index_canonical_email_blocks_on_reference_account_id"
end
create_table "circle_accounts", force: :cascade do |t|
t.bigint "circle_id"
t.bigint "account_id", null: false
t.bigint "follow_id", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_circle_accounts_on_account_id"
t.index ["circle_id", "account_id"], name: "index_circle_accounts_on_circle_id_and_account_id", unique: true
t.index ["circle_id"], name: "index_circle_accounts_on_circle_id"
t.index ["follow_id"], name: "index_circle_accounts_on_follow_id"
end
create_table "circles", force: :cascade do |t|
t.bigint "account_id", null: false
t.string "title", default: "", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["account_id"], name: "index_circles_on_account_id"
end
create_table "conversation_mutes", force: :cascade do |t|
t.bigint "conversation_id", null: false
t.bigint "account_id", null: false
@ -1341,6 +1361,10 @@ ActiveRecord::Schema[7.0].define(version: 2023_08_19_084858) do
add_foreign_key "bulk_import_rows", "bulk_imports", on_delete: :cascade
add_foreign_key "bulk_imports", "accounts", on_delete: :cascade
add_foreign_key "canonical_email_blocks", "accounts", column: "reference_account_id", on_delete: :cascade
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 "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
add_foreign_key "custom_filter_keywords", "custom_filters", on_delete: :cascade