Reviewed-on: #397 Co-authored-by: miteruzo <miteruzo@naver.com> Co-committed-by: miteruzo <miteruzo@naver.com>
このコミットはPull リクエスト #397 でマージされました.
このコミットが含まれているのは:
@@ -0,0 +1,31 @@
|
||||
class RebuildSettingsAsTypedUserSettings < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
remove_foreign_key :settings, :users if foreign_key_exists?(:settings, :users)
|
||||
remove_index :settings, :user_id if index_exists?(:settings, :user_id)
|
||||
|
||||
remove_column :settings, :key, :string if column_exists?(:settings, :key)
|
||||
remove_column :settings, :value, :json if column_exists?(:settings, :value)
|
||||
|
||||
change_column_null :settings, :user_id, false
|
||||
|
||||
add_column :settings, :theme, :string, null: false, default: 'system'
|
||||
add_column :settings,
|
||||
:auto_fetch_title,
|
||||
:string,
|
||||
null: false,
|
||||
default: 'manual'
|
||||
add_column :settings,
|
||||
:auto_fetch_thumbnail,
|
||||
:string,
|
||||
null: false,
|
||||
default: 'manual'
|
||||
add_column :settings,
|
||||
:wiki_editor_mode,
|
||||
:string,
|
||||
null: false,
|
||||
default: 'split'
|
||||
|
||||
add_index :settings, :user_id, unique: true
|
||||
add_foreign_key :settings, :users
|
||||
end
|
||||
end
|
||||
@@ -0,0 +1,22 @@
|
||||
class CreateUserThemeSlots < ActiveRecord::Migration[8.0]
|
||||
def change
|
||||
create_table :user_theme_slots do |t|
|
||||
t.references :user, null: false, foreign_key: true
|
||||
t.string :base_theme, null: false
|
||||
t.integer :slot_no, null: false
|
||||
t.json :tokens, null: false
|
||||
t.timestamps
|
||||
end
|
||||
|
||||
add_index :user_theme_slots,
|
||||
[:user_id, :base_theme, :slot_no],
|
||||
unique: true,
|
||||
name: 'index_user_theme_slots_on_user_theme_and_slot'
|
||||
add_check_constraint :user_theme_slots,
|
||||
"base_theme IN ('light', 'dark')",
|
||||
name: 'user_theme_slots_base_theme_valid'
|
||||
add_check_constraint :user_theme_slots,
|
||||
'slot_no BETWEEN 1 AND 3',
|
||||
name: 'user_theme_slots_slot_no_valid'
|
||||
end
|
||||
end
|
||||
新しい課題から参照
ユーザをブロックする