Add: #406 ユーザーのカスタムCSS (#825)

* Add: #406 ユーザーのカスタムCSS

* Fix lint

* Fix lint

* カスタムCSSの保存先を変更

* キャッシュを考慮して別URLに変更
This commit is contained in:
KMY(雪あすか) 2024-08-29 07:55:01 +09:00 committed by GitHub
parent 5ffd7593f1
commit 665c632d66
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
28 changed files with 283 additions and 4 deletions

View file

@ -0,0 +1,12 @@
# frozen_string_literal: true
class CreateCustomCsses < ActiveRecord::Migration[7.1]
def change
create_table :custom_csses do |t|
t.belongs_to :user, foreign_key: { on_delete: :cascade }, null: false
t.string :css, null: false, default: ''
t.timestamps
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.1].define(version: 2024_08_08_125420) do
ActiveRecord::Schema[7.1].define(version: 2024_08_28_123604) do
# These are extensions that must be enabled in order to support this database
enable_extension "plpgsql"
@ -479,6 +479,14 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_08_125420) do
t.index ["uri"], name: "index_conversations_on_uri", unique: true, opclass: :text_pattern_ops, where: "(uri IS NOT NULL)"
end
create_table "custom_csses", force: :cascade do |t|
t.bigint "user_id", null: false
t.string "css", default: "", null: false
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["user_id"], name: "index_custom_csses_on_user_id"
end
create_table "custom_emoji_categories", force: :cascade do |t|
t.string "name"
t.datetime "created_at", precision: nil, null: false
@ -1678,6 +1686,7 @@ ActiveRecord::Schema[7.1].define(version: 2024_08_08_125420) do
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_csses", "users", on_delete: :cascade
add_foreign_key "custom_filter_keywords", "custom_filters", on_delete: :cascade
add_foreign_key "custom_filter_statuses", "custom_filters", on_delete: :cascade
add_foreign_key "custom_filter_statuses", "statuses", on_delete: :cascade