Skip to content

Commit

Permalink
Add a .ledger file which is built by make examples (#445)
Browse files Browse the repository at this point in the history
Having this file in place makes it harder to commit two examples with
the same prefix since it would cause a merge conflict in the ledger.

You can also build only the ledger by running `make ledger`
  • Loading branch information
ryanslade authored Oct 31, 2024
1 parent db74779 commit b6fff69
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 1 deletion.
18 changes: 18 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
39 changes: 39 additions & 0 deletions examples/.ledger
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit b6fff69

Please sign in to comment.