File tree Expand file tree Collapse file tree 2 files changed +48
-30
lines changed Expand file tree Collapse file tree 2 files changed +48
-30
lines changed Original file line number Diff line number Diff line change @@ -46,38 +46,13 @@ is easy. Just implement the [source/driver interface](source/driver.go).
46
46
47
47
## CLI usage
48
48
49
+ __ [ CLI Documentation] ( cli/README.md ) __
50
+
51
+
52
+ Example:
53
+
49
54
```
50
- # dowload, build and install the CLI tool
51
- # -tags takes database and source drivers and will only build those
52
- $ go get -u -tags 'postgres' -o migrate github.com/mattes/migrate/cli
53
-
54
- $ migrate -help
55
- Usage: migrate OPTIONS COMMAND [arg...]
56
- migrate [ -version | -help ]
57
-
58
- Options:
59
- -source Location of the migrations (driver://url)
60
- -path Shorthand for -source=file://path
61
- -database Run migrations against this database (driver://url)
62
- -prefetch N Number of migrations to load in advance before executing (default 10)
63
- -verbose Print verbose logging
64
- -version Print version
65
- -help Print usage
66
-
67
- Commands:
68
- goto V Migrate to version V
69
- up [N] Apply all or N up migrations
70
- down [N] Apply all or N down migrations
71
- drop Drop everyting inside database
72
- version Print current migration version
73
-
74
-
75
- # so let's say you want to run the first two migrations
76
55
migrate -database postgres://localhost:5432/database up 2
77
-
78
- # if your migrations are hosted on github
79
- migrate -source github://mattes:personal-access-token@mattes/migrate_test \
80
- -database postgres://localhost:5432/database down 2
81
56
```
82
57
83
58
Original file line number Diff line number Diff line change
1
+ # CLI
2
+
3
+ ## Installation
4
+
5
+ ```
6
+ # dowload, build and install the CLI tool
7
+ # -tags takes database and source drivers and will only build those
8
+ $ go get -u -tags 'postgres' -o migrate github.com/mattes/migrate/cli
9
+ ```
10
+
11
+
12
+ ## Usage
13
+
14
+ ```
15
+ $ migrate -help
16
+ Usage: migrate OPTIONS COMMAND [arg...]
17
+ migrate [ -version | -help ]
18
+
19
+ Options:
20
+ -source Location of the migrations (driver://url)
21
+ -path Shorthand for -source=file://path
22
+ -database Run migrations against this database (driver://url)
23
+ -prefetch N Number of migrations to load in advance before executing (default 10)
24
+ -verbose Print verbose logging
25
+ -version Print version
26
+ -help Print usage
27
+
28
+ Commands:
29
+ goto V Migrate to version V
30
+ up [N] Apply all or N up migrations
31
+ down [N] Apply all or N down migrations
32
+ drop Drop everyting inside database
33
+ version Print current migration version
34
+
35
+
36
+ # so let's say you want to run the first two migrations
37
+ migrate -database postgres://localhost:5432/database up 2
38
+
39
+ # if your migrations are hosted on github
40
+ migrate -source github://mattes:personal-access-token@mattes/migrate_test \
41
+ -database postgres://localhost:5432/database down 2
42
+ ```
43
+
You can’t perform that action at this time.
0 commit comments