Code coverage report for code/data/migrations/migrations.coffee

Statements: 100% (9 / 9)      Branches: 50% (1 / 2)      Functions: 100% (4 / 4)      Lines: 100% (8 / 8)      Ignored: none     

All files » code/data/migrations/ » migrations.coffee
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21    1         1     9 18 18 9     5     10  
# Add new migrations here.
# I wasn't able to get automatic path globed `require` to work with gulp.
migrations = [
  require "./01_base"
  require "./02_add_relations"
]
 
module.exports =
  migrations: migrations
  update: (data) ->
    for m in migrations
      Eif m.update
        data = m.update(data)
    data
 
  latestVersion: ->
    @lastMigration().version
 
  lastMigration: ->
    _.max migrations, (m) -> m.version