You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fix(docs): Add ordering warning for numeric goose migration (#3481)
When using Goose with numeric migrations, if the migration files aren't in
lexographic order SQLC parses them in the wrong order. This is similar to the issue that occurs
with golang-migrate. This pr documents this behaviour.
Copy file name to clipboardExpand all lines: docs/howto/ddl.md
+25
Original file line number
Diff line number
Diff line change
@@ -145,6 +145,31 @@ type Post struct {
145
145
146
146
### goose
147
147
148
+
**Warning:**
149
+
sqlc parses migration files in lexicographic order. **If you are using numeric filenames for migrations in Goose and you choose to have sqlc enumerate your migration files**,
150
+
make sure their numeric ordering matches their lexicographic ordering to avoid
151
+
unexpected behavior. This can be done by prepending enough zeroes to the
0 commit comments