Go/migrate: Difference between revisions
< Go
Jump to navigation
Jump to search
| Line 18: | Line 18: | ||
migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" down | migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" down | ||
</syntaxhighlight> | </syntaxhighlight> | ||
} | |} | ||
== DSN Problem == | == DSN Problem == | ||
Revision as of 10:27, 28 July 2026
Best practice
| Purpose | Command |
|---|---|
| create |
migrate create -ext sql -dir assets/migrations -seq {{.CLI_ARGS}}
|
| up |
migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" up
|
| down |
migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" down
|