我创建了基于用户的管理模型:
{
"name": "Admin",
"plural": "admins",
"base": "User",
"strict": true,
"properties": {
"email": {
"type": "string",
"mysql": {
"dataType": "VARCHAR",
"dataLength": 50
}
},
"password": {
"type": "string",
"mysql": {
"dataType": "VARCHAR",
"dataLength": 60
}
},
},
"validations": [],
"relations": {},
"acls": [],
"methods": []
}
在 MySQL db 中描述 Admin 表会显示来自 User 模型的额外列:
+-------------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| email | varchar(50) | YES | | NULL | |
| password | varchar(60) | YES | | NULL | |
| realm | varchar(512) | YES | | NULL | |
| username | varchar(512) | YES | | NULL | |
| credentials | text | YES | | NULL | |
| challenges | text | YES | | NULL | |
| emailVerified | tinyint(1) | YES | | NULL | |
| verificationToken | varchar(512) | YES | | NULL | |
| status | varchar(512) | YES | | NULL | |
| created | datetime | YES | | NULL | |
| lastUpdated | datetime | YES | | NULL | |
+-------------------+--------------+------+-----+---------+----------------+
有什么办法可以避免用一些额外的道具填充表格?