File tree Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Expand file tree Collapse file tree 2 files changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ package gloat
2
2
3
3
import (
4
4
"database/sql"
5
+ "time"
5
6
)
6
7
7
8
// Gloat glues all the components needed to apply and revert
@@ -86,6 +87,7 @@ func (c *Gloat) Current() (*Migration, error) {
86
87
87
88
// Apply applies a migration.
88
89
func (c * Gloat ) Apply (migration * Migration ) error {
90
+ migration .AppliedAt = time .Now ().UTC ()
89
91
return c .Executor .Up (migration , c .Store )
90
92
}
91
93
Original file line number Diff line number Diff line change @@ -199,6 +199,7 @@ func TestCurrent_Nil(t *testing.T) {
199
199
func TestApply (t * testing.T ) {
200
200
called := false
201
201
202
+ m := & Migration {}
202
203
gl .Store = & testingStore {}
203
204
gl .Executor = & stubbedExecutor {
204
205
up : func (* Migration , Store ) error {
@@ -207,9 +208,10 @@ func TestApply(t *testing.T) {
207
208
},
208
209
}
209
210
210
- gl .Apply (nil )
211
+ gl .Apply (m )
211
212
212
213
assert .True (t , called )
214
+ assert .NotEmpty (t , m .AppliedAt )
213
215
}
214
216
215
217
func TestRevert (t * testing.T ) {
You can’t perform that action at this time.
0 commit comments