test(migrate): verify canonical SQL-only version ordering
This commit is contained in:
1 parent
badeefb9a9
commit
d912b475b5
5 files changed
+77
-9
No files matched your search
+13
-5
@@ -40,11 +40,19 @@ not defer it when sharing the pool with the application. Use `"."` for SQL files
|
||||
at the embedded root. Files in the selected directory are discovered directly,
|
||||
without recursively searching subdirectories.
|
||||
|
||||
Use unique positive versions in filenames such as
|
||||
`20261027114500_create_users.sql`; sequential versions such as `00007_users.sql`
|
||||
also work. Never derive a version from a file count or add one to the current
|
||||
version. Keep applied migrations immutable and ship the complete history.
|
||||
Goose rejects newly introduced migrations below the current version by default.
|
||||
Use unique positive versions and Goose's migration creator naming convention:
|
||||
zero-padded sequential names such as `00007_users.sql` and `00010_events.sql`, or
|
||||
fixed-width timestamps such as `20261027114500_create_users.sql`. Filenames must
|
||||
sort lexically in numeric version order, including when mixing naming schemes;
|
||||
choose padding wide enough for the complete history. Goose v3.29.0 preserves
|
||||
lexical source order for SQL-only providers, so arbitrary unpadded names such as
|
||||
`7_users.sql` and `10_events.sql` are unsupported by this house convention: they
|
||||
can produce incorrect latest versions and source/status ordering. This package
|
||||
does not rename or normalize migration files.
|
||||
|
||||
Never derive a version from a file count or add one to the current version.
|
||||
Keep applied migrations immutable and ship the complete history. Goose rejects
|
||||
newly introduced migrations below the current version by default.
|
||||
|
||||
```sql
|
||||
-- +goose Up
|
||||
|
||||
Reference in new issue
Block a user