Allow force running of --once if current.sql has not changed

オープン
#210 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
35/100
issue の種類
機能追加
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
postgresql, sql, typescript
領域
cli, databases

調査の方向性

まず、--once の処理と、current.sql が変更されたかどうかを検出するロジックを追跡します。force オプションがそのチェックとどのように相互作用すべきかを判断し、その後、既存の migration tests または見つけた test entry points で動作を検証します。明示的に強制した場合に、変更されていない current.sql を繰り返し実行できれば完了です。

索引モデルが issue の本文から書いたものです。

説明

Feature description

Often we use tricks like select n and increment the number or change current.sql in another way to get it to run.

It would be handy to have a flag to force run --once if the file hasn't changed.

Motivating example

When testing a data migration, it is often very handy to have an idempotent migration that can get run multiple times as you add/change data in your application.

Typical workflow for me in a data migration involves

  • Keep the original data I am moving in place (if possible)
  • Run the migration, check for base functionality, compare against existing
  • Add more data to test the migration and run it again (rinse and repeat as needed)
  • Once tested, add code to cleanup the original data, test again, and ship

Though workarounds are simple as described in the feature description, I think it would be a nice add.

Breaking changes

n/a

Supporting development

I [tick all that apply]:

  • am interested in building this feature myself
  • am interested in collaborating on building this feature
  • [ x ] am willing to help testing this feature before it's released
  • am willing to write a test-driven test suite for this feature (before it exists)
  • [ x ] am a Graphile sponsor ❤️
  • [ x ] have an active support or consultancy contract with Graphile
主要言語
TypeScript
スター
836
フォーク
71
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

graphile/migrate のほかの issue

graphile/migrate の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。