We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 3c71508 commit 7b58dedCopy full SHA for 7b58ded
source/pkger/README.md
@@ -0,0 +1,29 @@
1
+# pkger
2
+```
3
+package main
4
+
5
+import (
6
+ "errors"
7
+ "log"
8
9
+ "github.com/golang-migrate/migrate/v4"
10
+ "github.com/markbates/pkger"
11
12
+ _ "github.com/golang-migrate/migrate/v4/database/postgres"
13
+ _ "github.com/golang-migrate/migrate/v4/source/pkger"
14
+ _ "github.com/lib/pq"
15
+)
16
17
+func main() {
18
+ pkger.Include("/module/path/to/migrations")
19
+ m, err := migrate.New("pkger:///module/path/to/migrations", "postgres://postgres@localhost/postgres?sslmode=disable")
20
+ if err != nil {
21
+ log.Fatalln(err)
22
+ }
23
+ if err := m.Up(); errors.Is(err, migrate.ErrNoChange) {
24
+ log.Println(err)
25
+ } else if err != nil {
26
27
28
+}
29
0 commit comments