Init commit
This commit is contained in:
@@ -0,0 +1,18 @@
|
||||
const Permission = require('./permissionModel')
|
||||
const chalk = require('chalk')
|
||||
|
||||
const runSeeder = async () => {
|
||||
const permissions = []
|
||||
|
||||
await Permission.deleteMany({})
|
||||
console.log(chalk.red('Deleted all permission records.'))
|
||||
|
||||
await Permission.insertMany(permissions, null)
|
||||
console.log(
|
||||
chalk.green.bold(
|
||||
`PERMISSION: Created ${permissions.length} permission(s)`
|
||||
)
|
||||
)
|
||||
}
|
||||
|
||||
module.exports = { runSeeder }
|
||||
Reference in New Issue
Block a user