diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 47c5f47b..5a2121e9 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -83,6 +83,24 @@ jobs: exit 1 fi + check-ledger: + name: check ledger + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Generate ledger + run: | + make ledger + + - name: Ensure ledger is up to date + run: | + if ! git diff --quiet; then + echo "generated ledger is out of date!" + echo "run 'make ledger' to regenerate the ledger" + exit 1 + fi + dead-code-check: name: dead code check runs-on: ubuntu-latest diff --git a/Makefile b/Makefile index a29c1c2c..45ed85aa 100644 --- a/Makefile +++ b/Makefile @@ -25,7 +25,10 @@ generate: format lint: golangci-lint --config=.golangci.yml run -examples: +ledger: + cd examples && ls > .ledger + +examples: ledger @go build @./pgroll init @./pgroll bootstrap examples diff --git a/examples/.ledger b/examples/.ledger new file mode 100644 index 00000000..9e8bd01d --- /dev/null +++ b/examples/.ledger @@ -0,0 +1,39 @@ +01_create_tables.json +02_create_another_table.json +03_add_column.json +04_rename_table.json +05_sql.json +06_add_column_to_sql_table.json +07_drop_table.json +08_create_fruits_table.json +09_drop_column.json +10_create_index.json +11_drop_index.json +12_create_employees_table.json +13_rename_column.json +14_add_reviews_table.json +15_set_column_unique.json +16_set_nullable.json +17_add_rating_column.json +18_change_column_type.json +19_create_orders_table.json +20_create_posts_table.json +21_add_foreign_key_constraint.json +22_add_check_constraint.json +23_drop_check_constraint.json +24_drop_foreign_key_constraint.json +25_add_table_with_check_constraint.json +26_add_column_with_check_constraint.json +27_drop_unique_constraint.json +28_different_defaults.json +29_set_replica_identity.json +30_add_column_simple_up.json +31_unset_not_null.json +32_sql_on_complete.json +33_rename_check_constraint.json +34_create_events_table.json +35_alter_column_multiple.json +36_set_comment_to_null.json +37_create_partial_index.json +38_create_hash_index_with_fillfactor.json +39_add_column_with_multiple_pk_in_table.json