Init commit
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
const Role = require('./roleModel')
|
||||
const chalk = require('chalk')
|
||||
|
||||
const runSeeder = async () => {
|
||||
const roles = [
|
||||
{
|
||||
_id: '66a0144569a37efa10d13628',
|
||||
englishName: 'Admin',
|
||||
nativeName: 'ادمین',
|
||||
permissions: ['66a014057b80c4788e41aab7'],
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
_id: '66a2da5b9b989a8909948848',
|
||||
englishName: 'SuperAdmin',
|
||||
nativeName: 'ادمین اصلی',
|
||||
permissions: [],
|
||||
isActive: true,
|
||||
},
|
||||
{
|
||||
_id: '66a0144569a37efa10d13629',
|
||||
englishName: 'User',
|
||||
nativeName: 'کاربر',
|
||||
permissions: [],
|
||||
isActive: true,
|
||||
},
|
||||
]
|
||||
|
||||
await Role.deleteMany({})
|
||||
console.log(chalk.red('Deleted all role records.'))
|
||||
|
||||
await Role.insertMany(roles, null)
|
||||
console.log(chalk.green.bold(`ROLE: Created ${roles.length} role(s)`))
|
||||
}
|
||||
|
||||
module.exports = { runSeeder }
|
||||
Reference in New Issue
Block a user