diff --git a/db/migrate/20260218120000_restore_unique_index_on_board_publication_key.rb b/db/migrate/20260218120000_restore_unique_index_on_board_publication_key.rb new file mode 100644 index 000000000..dfcd5edaf --- /dev/null +++ b/db/migrate/20260218120000_restore_unique_index_on_board_publication_key.rb @@ -0,0 +1,7 @@ +class RestoreUniqueIndexOnBoardPublicationKey < ActiveRecord::Migration[8.2] + def change + add_index :board_publications, :key, unique: true + add_index :board_publications, :account_id + remove_index :board_publications, [:account_id, :key] + end +end diff --git a/db/schema.rb b/db/schema.rb index e74a97212..20cb0d161 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.2].define(version: 2026_02_13_170100) do +ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do create_table "accesses", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| t.datetime "accessed_at" t.uuid "account_id", null: false @@ -147,8 +147,9 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_13_170100) do t.datetime "created_at", null: false t.string "key" t.datetime "updated_at", null: false - t.index ["account_id", "key"], name: "index_board_publications_on_account_id_and_key" + t.index ["account_id"], name: "index_board_publications_on_account_id" t.index ["board_id"], name: "index_board_publications_on_board_id" + t.index ["key"], name: "index_board_publications_on_key", unique: true end create_table "boards", id: :uuid, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t| diff --git a/db/schema_sqlite.rb b/db/schema_sqlite.rb index e06492288..c8ce19e07 100644 --- a/db/schema_sqlite.rb +++ b/db/schema_sqlite.rb @@ -10,7 +10,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema[8.2].define(version: 2026_02_13_170100) do +ActiveRecord::Schema[8.2].define(version: 2026_02_18_120000) do create_table "accesses", id: :uuid, force: :cascade do |t| t.datetime "accessed_at" t.uuid "account_id", null: false @@ -147,8 +147,9 @@ ActiveRecord::Schema[8.2].define(version: 2026_02_13_170100) do t.datetime "created_at", null: false t.string "key", limit: 255 t.datetime "updated_at", null: false - t.index ["account_id", "key"], name: "index_board_publications_on_account_id_and_key" + t.index ["account_id"], name: "index_board_publications_on_account_id" t.index ["board_id"], name: "index_board_publications_on_board_id" + t.index ["key"], name: "index_board_publications_on_key", unique: true end create_table "boards", id: :uuid, force: :cascade do |t|