このコミットが含まれているのは:
@@ -13,7 +13,8 @@ class AddNamesToTagVersions < ActiveRecord::Migration[8.0]
|
||||
language_code: 'ja',
|
||||
name: version.name,
|
||||
script_code: 'Jpan',
|
||||
primary_flg: true }]
|
||||
primary_flg: true,
|
||||
auto_generated: false }]
|
||||
names.concat(version.aliases.to_s.split.filter_map { |name|
|
||||
next if name.blank?
|
||||
|
||||
@@ -21,7 +22,8 @@ class AddNamesToTagVersions < ActiveRecord::Migration[8.0]
|
||||
language_code: 'ja',
|
||||
name:,
|
||||
script_code: 'Jpan',
|
||||
primary_flg: false }
|
||||
primary_flg: false,
|
||||
auto_generated: false }
|
||||
})
|
||||
version.update_columns(names: names)
|
||||
end
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
class AddAutoGeneratedToTagNames < ActiveRecord::Migration[8.0]
|
||||
class TagVersion < ActiveRecord::Base
|
||||
self.table_name = 'tag_versions'
|
||||
end
|
||||
|
||||
def up
|
||||
add_column :tag_names, :auto_generated, :boolean, null: false, default: false
|
||||
TagVersion.reset_column_information
|
||||
|
||||
TagVersion.find_each do |version|
|
||||
names = Array(version.names).map { |name| name.merge('auto_generated' => false) }
|
||||
version.update_columns(names: names)
|
||||
end
|
||||
end
|
||||
|
||||
def down
|
||||
remove_column :tag_names, :auto_generated
|
||||
end
|
||||
end
|
||||
生成ファイル
+2
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[8.0].define(version: 2026_09_22_040000) do
|
||||
ActiveRecord::Schema[8.0].define(version: 2026_09_22_050000) do
|
||||
create_table "active_storage_attachments", charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
|
||||
t.string "name", null: false
|
||||
t.string "record_type", null: false
|
||||
@@ -454,6 +454,7 @@ ActiveRecord::Schema[8.0].define(version: 2026_09_22_040000) do
|
||||
t.datetime "created_at", null: false
|
||||
t.datetime "updated_at", null: false
|
||||
t.virtual "primary_tag_id", type: :bigint, as: "(case when `primary_flg` then `tag_id` else NULL end)"
|
||||
t.boolean "auto_generated", default: false, null: false
|
||||
t.index ["canonical_id"], name: "index_tag_names_on_canonical_id"
|
||||
t.index ["language_code", "name"], name: "index_tag_names_on_language_code_and_name", unique: true
|
||||
t.index ["primary_tag_id", "language_code"], name: "index_tag_names_on_primary_tag_id_and_language_code", unique: true
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする