Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Best practices for Migration vs Schema.sql? #1928

Unanswered
petersng asked this question in Issue Triage
Discussion options

Hi, so I have a project that has multiple components separating into different packages that logically separate certain parts of the db schema. I have been setting up sqlc.yaml to have multiple schema.sql and query.sql for each of these components. However, we also have migration SQL files that encompass all schemas and updates across all these different components. This seems like a duplication of schema data, so I have been looking into trying just to have sqlc examine the migration files and not store schema.sql files in each component.

My question is, is it a common pattern to have both schema.sql and migration files? Does one typically use just migration files? A related question is if schema.sql should be treated like migration files (i.e. include ALTER, etc) or if should it represent the schema in the current version of the code.

You must be logged in to vote

Replies: 0 comments

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
1 participant

AltStyle によって変換されたページ (->オリジナル) /