chore: 后端首次基线提交
运行必须源码:app/(controller/model/service/middleware/lib/utils/validate/router)、config/、database/(migrations/seeders/sql)、启动脚本、app/public/templates 模板。 已忽略运行非必须:node_modules/、logs/、run/、app/public 运行时上传数据、.env*、构建/缓存产物。
This commit is contained in:
36
database/seeders/002-seed-admin.js
Normal file
36
database/seeders/002-seed-admin.js
Normal file
@@ -0,0 +1,36 @@
|
||||
'use strict';
|
||||
|
||||
module.exports = {
|
||||
up: async (queryInterface, Sequelize) => {
|
||||
const now = new Date();
|
||||
await queryInterface.bulkInsert('accounts', [
|
||||
{
|
||||
role: 'admin',
|
||||
name_cn: '系统管理员',
|
||||
name_en: 'Administrator',
|
||||
gender: null,
|
||||
phone: null,
|
||||
email: 'admin@competition.com',
|
||||
id_number: '000000000000000000',
|
||||
password: '$2b$10$Nc6PCJItIwuOzpM22dTiAezB.jZMI8mzkCbg3oRZkAWx.QaI4co9.',
|
||||
salt: '$2b$10$Nc6PCJItIwuOzpM22dTiAe',
|
||||
position: '系统管理员',
|
||||
major: null,
|
||||
country: '中国',
|
||||
region: null,
|
||||
organization_cn: '赛事组委会',
|
||||
organization_en: 'Competition Committee',
|
||||
activated: 1,
|
||||
score: null,
|
||||
created_at: now,
|
||||
updated_at: now,
|
||||
},
|
||||
], {});
|
||||
},
|
||||
|
||||
down: async (queryInterface, Sequelize) => {
|
||||
await queryInterface.bulkDelete('accounts', {
|
||||
id_number: '000000000000000000',
|
||||
}, {});
|
||||
},
|
||||
};
|
||||
Reference in New Issue
Block a user