@@ -359,3 +359,20 @@ func (s *SqliteMigrateSuite) TestPlanMigrationWithHoles(c *C) {
359359 c .Assert (plannedMigrations [2 ].Migration .Id , Equals , "2" )
360360 c .Assert (plannedMigrations [2 ].Queries [0 ], Equals , down )
361361}
362+
363+ func (s * SqliteMigrateSuite ) TestLessTwoNumeric (c * C ) {
364+ c .Assert ((Migration {Id : "1" }).Less (& Migration {Id : "2" }), Equals , true ) // 1 less than 2
365+ c .Assert ((Migration {Id : "2" }).Less (& Migration {Id : "1" }), Equals , false ) // 2 not less than 1
366+ c .Assert ((Migration {Id : "1" }).Less (& Migration {Id : "a" }), Equals , true ) // 1 less than a
367+ c .Assert ((Migration {Id : "a" }).Less (& Migration {Id : "1" }), Equals , false ) // a not less than 1
368+ c .Assert ((Migration {Id : "a" }).Less (& Migration {Id : "a" }), Equals , false ) // a not less than a
369+ c .Assert ((Migration {Id : "1-a" }).Less (& Migration {Id : "1-b" }), Equals , true ) // 1-a less than 1-b
370+ c .Assert ((Migration {Id : "1-b" }).Less (& Migration {Id : "1-a" }), Equals , false ) // 1-b not less than 1-a
371+ // 20160126_1100 less than 20160126_1200
372+ c .Assert ((Migration {Id : "20160126_1100" }).
373+ Less (& Migration {Id : "20160126_1200" }), Equals , true )
374+ // 20160126_1200 not less than 20160126_1100
375+ c .Assert ((Migration {Id : "20160126_1200" }).
376+ Less (& Migration {Id : "20160126_1100" }), Equals , false )
377+
378+ }
0 commit comments