https://github.com/lineoit/go-migrate
Database migrations library for golang
https://github.com/lineoit/go-migrate
database go-migrate golang migration postgresql
Last synced: 6 months ago
JSON representation
Database migrations library for golang
- Host: GitHub
- URL: https://github.com/lineoit/go-migrate
- Owner: LineoIT
- License: mit
- Created: 2022-12-05T13:03:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-08-12T13:14:22.000Z (11 months ago)
- Last Synced: 2025-08-12T15:14:31.768Z (11 months ago)
- Topics: database, go-migrate, golang, migration, postgresql
- Language: Go
- Homepage:
- Size: 6.84 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Golang migrate
### Install
```
go get -u github.com/LineoIT/go-migrate
```
### How to use
```go
package main
import (
"github.com/LineoIT/go-migrate"
"log"
_ "github.com/lib/pq"
)
func main() {
m, err := migrate.New("postgres",
"postgres://postgres:postgres@localhost/demo?sslmode=disable",
"./migrations",
)
if err != nil {
log.Fatal(err)
}
if err := m.Migrate(); err != nil {
panic(err)
}
}
```
**Note**: Do not forget import db driver `github.com/lib/pq` for postgres