loopbackio / loopbackio/loopback-connector-postgresql
Properties with underscores in their name cannot be indexed
オープン
まだ誰も着手していません。
bug
good first issue
help wanted
- 主要言語
- JavaScript
- スター
- 118
- フォーク
- 184
- 平均マージ
- 1日 22時間
- マージ済み PR(30日)
- 5
説明
Steps to reproduce
- create a model with a property name that contains an underscore in it (e.g. short_name).
- set that property to be indexed (e.g.
"index": true) - call
pg.autoupdate()(e.g. whereapp.datasources.pg);
Current Behavior
- The index is added
- Then the index is dropped
Expected Behavior
- The index is added
Additional information
The bug shown here is a bad regular expression in migration.js (on or about line 777):
const propNameRegEx = new RegExp('^' + self.table(model) + '_([^_]+)_idx');
The simple fix is:
const propNameRegEx = new RegExp('^' + self.table(model) + '_(.*)(?:_idx)$');
コントリビューションガイド
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
調査の方向性
migration.js の 777 行目付近から始め、アンダースコアを含むプロパティを使って報告されたモデル設定を再現し、その後 pg.autoupdate() を呼び出します。マイグレーション後も既存のインデックスが残っていること、およびプロパティ名にアンダースコアが含まれている場合に正しく照合されることを確認してください。
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript, postgresql
- 領域
- databases
- issue の種類
- バグ
- 難易度
- 1/5
- 見積もり時間
- 1時間未満
- 活発さ
- 停滞
- 明瞭さ
- 明確に書かれている
- 初心者へのやさしさ
- 45/100