refs #6434 feat: create signInLog table
This commit is contained in:
parent
89967b8538
commit
e0f6d08a1e
|
@ -0,0 +1,19 @@
|
|||
|
||||
|
||||
--
|
||||
-- Table structure for table `signInLog`
|
||||
--
|
||||
|
||||
DROP TABLE IF EXISTS `account`.`signInLog`;
|
||||
/*!40101 SET @saved_cs_client = @@character_set_client */;
|
||||
/*!40101 SET character_set_client = utf8 */;
|
||||
CREATE TABLE `account`.`signInLog` (
|
||||
`id` varchar(10) NOT NULL ,
|
||||
`userFk` int(10) unsigned DEFAULT NULL,
|
||||
`creationDate` timestamp NULL DEFAULT current_timestamp(),
|
||||
`ip` varchar(100) CHARACTER SET utf8mb3 COLLATE utf8mb3_general_ci NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `userFk` (`userFk`),
|
||||
CONSTRAINT `signInLog_ibfk_1` FOREIGN KEY (`userFk`) REFERENCES `user` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
|
||||
);
|
||||
|
|
@ -35,6 +35,9 @@
|
|||
"SambaConfig": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"SignInLog": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
"Sip": {
|
||||
"dataSource": "vn"
|
||||
},
|
||||
|
|
|
@ -0,0 +1,34 @@
|
|||
{
|
||||
"name": "SignInLog",
|
||||
"base": "VnModel",
|
||||
"options": {
|
||||
"mysql": {
|
||||
"table": "account.signInLog"
|
||||
}
|
||||
},
|
||||
"properties": {
|
||||
"id": {
|
||||
"id": true,
|
||||
"type": "string"
|
||||
},
|
||||
"creationDate": {
|
||||
"type": "date"
|
||||
},
|
||||
"userFk": {
|
||||
"type": "number"
|
||||
},
|
||||
"ip": {
|
||||
"type": "string"
|
||||
}
|
||||
},
|
||||
"relations": {
|
||||
"user": {
|
||||
"type": "belongsTo",
|
||||
"model": "VnUser",
|
||||
"foreignKey": "userFk"
|
||||
}
|
||||
},
|
||||
"scope": {
|
||||
"order": ["creationDate DESC", "id DESC"]
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue