Go/migrate: Difference between revisions

From Fundamental Ramen
< Go
Jump to navigation Jump to search
(Created page with "== Best practice == === up === === down === === create === == DSN Problem ==")
 
Line 1: Line 1:
== Best practice ==
== Best practice ==


=== up ===
{| class="wikitable"
 
! Purpose || Command
 
|-
=== down ===
| create ||
 
<syntaxhighlight lang="bash">
 
migrate create -ext sql -dir assets/migrations -seq {{.CLI_ARGS}}
=== create ===
</syntaxhighlight>
 
|-
| up ||
<syntaxhighlight lang="bash">
migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" up
</syntaxhighlight>
|-
| down ||
<syntaxhighlight lang="bash">
migrate -path assets/migrations -database "postgres://sysop:mypass@localhost:45432/mydb" down
</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

}

DSN Problem