This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
// 导出一个函数,这个函数接受数据库对象db和一个回调函数callback作为参数
module.exports = function(db, callback) {
// 用户模型
// 使用db.define方法定义一个模型,模型名为PermissionAPIModel
db.define("PermissionAPIModel", {
// 定义模型的属性
id: {type: 'serial', key: true},
// 唯一标识ID,自增主键
ps_id: Number,
// 权限ID,类型为数字
ps_api_service: String,
// API服务名称,类型为字符串
ps_api_action: String,
// API动作名称,类型为字符串
ps_api_order: Number
// API顺序,类型为数字
}, {
// 定义模型的选项
table: "sp_permission_api"
// 指定模型对应的数据库表名为sp_permission_api
});
// 调用回调函数,传入无参数
return callback();
}