Skip to content

Commit

Permalink
Merge pull request #1 from UniversityOfHelsinkiCS/trunk
Browse files Browse the repository at this point in the history
migrations
  • Loading branch information
sasumaki authored Jan 21, 2019
2 parents bf18662 + 0edc661 commit f838ffa
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/database/migrations/20190113_fix_accessgroups.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ module.exports = {
},
down: async () => {
}
}
}
19 changes: 19 additions & 0 deletions src/database/migrations/20190121_seed_accessgroups.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
const { AccessGroup, User } = require('../../models')
defaultAccessGroups = [
{
group_code: 'teachers',
group_info: 'grants access to teacher statistics',
},
{
group_code: 'admin',
group_info: 'grants access to everything'
}
]
module.exports = {
up: async (queryInterface, Sequelize) => {
AccessGroup.bulkCreate(defaultAccessGroups)
},
down: async () => {
AccessGroup.destroy({ where: { group_code: ['teachers', 'admin'] } })
}
}

0 comments on commit f838ffa

Please sign in to comment.