refs #6434 feat: create signInLog table

This commit is contained in:
Javier Segarra 2023-11-15 13:49:41 +01:00
parent 89967b8538
commit e0f6d08a1e
3 changed files with 56 additions and 0 deletions

View File

@ -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
);

View File

@ -35,6 +35,9 @@
"SambaConfig": {
"dataSource": "vn"
},
"SignInLog": {
"dataSource": "vn"
},
"Sip": {
"dataSource": "vn"
},

View File

@ -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"]
}
}