You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you are using MySQL, you must append ?parseTime=true to the datasource configuration. For example:
83
82
@@ -89,7 +88,7 @@ If you are using MySQL, you must append ?parseTime=true to the datasource config
89
88
90
89
See https://github.com/go-sql-driver/mysql#parsetime for more information.
91
90
92
-
Library
91
+
# Library
93
92
94
93
Import sql-migrate into your application:
95
94
@@ -137,7 +136,7 @@ Note that n can be greater than 0 even if there is an error: any migration that
137
136
138
137
The full set of capabilities can be found in the API docs below.
139
138
140
-
Writing migrations
139
+
# Writing migrations
141
140
142
141
Migrations are defined in SQL files, which contain a set of SQL statements. Special comments are used to distinguish up and down migrations.
143
142
@@ -183,7 +182,7 @@ Normally each migration is run within a transaction in order to guarantee that i
183
182
-- +migrate Down
184
183
DROP INDEX people_unique_id_idx;
185
184
186
-
Embedding migrations with packr
185
+
# Embedding migrations with packr
187
186
188
187
If you like your Go applications self-contained (that is: a single binary): use packr (https://github.com/gobuffalo/packr) to embed the migration files.
189
188
@@ -202,7 +201,7 @@ If you already have a box and would like to use a subdirectory:
202
201
Dir: "./migrations",
203
202
}
204
203
205
-
Embedding migrations with bindata
204
+
# Embedding migrations with bindata
206
205
207
206
As an alternative, but slightly less maintained, you can use bindata (https://github.com/shuLhan/go-bindata) to embed the migration files.
208
207
@@ -226,7 +225,7 @@ Both Asset and AssetDir are functions provided by bindata.
226
225
227
226
Then proceed as usual.
228
227
229
-
Extending
228
+
# Extending
230
229
231
230
Adding a new migration source means implementing MigrationSource.
0 commit comments