Repository navigation
docs: read the sample and quickstart schema from migrations - #47
Merged
omer-cengel merged 2 commits intoSep 27, 2026
Merged
Conversation
The sample's sqlcj.yaml names sql/migrations instead of a schema snapshot. V1 creates authors and books, and V2 adds authors.created_at and an index on books (author_id). The release script generates from the directory, checks that the generated row carries the added column, and applies both migrations with psql in version order before running the sample.
omer-cengel
deleted the
chore/sample-and-quickstart-migration-directory
branch
September 27, 2026 22:10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The external Maven sample and the quickstart now point
sql[].schemaat a Flyway-stylesql/migrationsdirectory instead of a single schema snapshot. This shows sqlcj reading the schema an application already maintains through migrations. The later migration adds a column and an index, and the generated repository and the sample's output stay the same.Changes
sql/schema.sqlwithV1__create_authors_and_books.sql, which createsauthors (id, name, bio)andbooks, andV2__add_author_created_at_and_book_index.sql, which addsauthors.created_atand creates an index onbooks (author_id).sqlcj.yamltoschema: sql/migrationsand update theAppJavadoc to describe the migrations being applied in version order.LocalDateTime createdAt, and apply both migrations withpsqlin version order underON_ERROR_STOPbefore running the sample.ALTER TABLE ... ADD COLUMNapplies to the table created earlier, and whyCREATE INDEXis accepted and ignored.Scope and non-goals
psql.