From 99ab521df32e1e63a31a862c768c98e82329bdee Mon Sep 17 00:00:00 2001 From: Sam Webster <44712417+samfweb@users.noreply.github.com> Date: Wed, 19 Jul 2023 17:21:28 +1000 Subject: [PATCH 1/2] Add example sqlc.yaml for migration parsing --- docs/howto/ddl.md | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/docs/howto/ddl.md b/docs/howto/ddl.md index b0b4d2651e..362bc5ef91 100644 --- a/docs/howto/ddl.md +++ b/docs/howto/ddl.md @@ -37,6 +37,21 @@ sqlc supports parsing migrations from the following tools: - [sql-migrate](https://github.com/rubenv/sql-migrate) - [tern](https://github.com/jackc/tern) +To enable migration parsing, specify the migration directory instead of a schema file: + +```yaml +version: "2" +sql: + - engine: "postgresql" + queries: "query.sql" + schema: "../../db/migrations" + gen: + go: + package: "tutorial" + out: "tutorial" +``` + + ### goose ```sql From ad909b02be073ab0121be131761fdda462e3c2f3 Mon Sep 17 00:00:00 2001 From: Kyle Conroy Date: Mon, 24 Jul 2023 09:41:41 -0700 Subject: [PATCH 2/2] Update docs/howto/ddl.md --- docs/howto/ddl.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/howto/ddl.md b/docs/howto/ddl.md index 362bc5ef91..44b94b0174 100644 --- a/docs/howto/ddl.md +++ b/docs/howto/ddl.md @@ -44,7 +44,7 @@ version: "2" sql: - engine: "postgresql" queries: "query.sql" - schema: "../../db/migrations" + schema: "db/migrations" gen: go: package: "tutorial"