- Search Data
- Auth JWT
- Middleware
- Dockerisation
- Darkmode UI
#golang-migration
firstime you need instal package golang-migrate
brew install golang-migrate
#create migration
- original :
migrate create -ext sql -dir <path> -seq <migration_name>
example :
migrate create -ext sql -dir config/migrations -seq tags
- modif on your mac
- nano ~/.zshrc
- add alias
alias go-migrate="migrate create -ext sql"
- and then create migration like this :
go-migrate -dir <path> -seq <migration_name>
example :
go-migrate -dir config/migrations -seq tags
migrate -path <path> -database ‘<connection_string>’ -verbose up
example :
migrate -path config/migrations/ -database 'mysql://user:password@/database_name' -verbose up
migrate -path <path> -database ‘<connection_string>’ -verbose down
example :
migrate -path config/migrations/ -database 'mysql://user:password@/database_name’ -verbose down