From a7a464dc36543e54dcccde487c7f041fbc3b6d5b Mon Sep 17 00:00:00 2001 From: david Date: Tue, 15 Oct 2019 18:23:55 +0200 Subject: [PATCH] Error en el nombre de la tabla 'user_devices' --- bd-produccion.sql | 16 ++++++++-------- modules/push/user_device.model.js | 2 +- script-carga-bd-completa.sql | 16 ++++++++-------- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/bd-produccion.sql b/bd-produccion.sql index c61da6b..c78b686 100755 --- a/bd-produccion.sql +++ b/bd-produccion.sql @@ -781,13 +781,13 @@ INSERT INTO `users` VALUES ('9c6cc75e-8c1a-4f19-8e40-9ba1a747af01','+34691526639 UNLOCK TABLES; -- --- Table structure for table `users_devides` +-- Table structure for table `users_devices` -- -DROP TABLE IF EXISTS `users_devides`; +DROP TABLE IF EXISTS `users_devices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!50503 SET character_set_client = utf8mb4 */; -CREATE TABLE `users_devides` ( +CREATE TABLE `users_devices` ( `id` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `userId` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `token` varchar(255) DEFAULT NULL, @@ -798,17 +798,17 @@ CREATE TABLE `users_devides` ( `updatedAt` datetime NOT NULL, PRIMARY KEY (`id`), KEY `userId` (`userId`), - CONSTRAINT `users_devides_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE + CONSTRAINT `users_devices_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `users_devides` +-- Dumping data for table `users_devices` -- -LOCK TABLES `users_devides` WRITE; -/*!40000 ALTER TABLE `users_devides` DISABLE KEYS */; -/*!40000 ALTER TABLE `users_devides` ENABLE KEYS */; +LOCK TABLES `users_devices` WRITE; +/*!40000 ALTER TABLE `users_devices` DISABLE KEYS */; +/*!40000 ALTER TABLE `users_devices` ENABLE KEYS */; UNLOCK TABLES; -- diff --git a/modules/push/user_device.model.js b/modules/push/user_device.model.js index d0ddbaa..32dc120 100644 --- a/modules/push/user_device.model.js +++ b/modules/push/user_device.model.js @@ -17,7 +17,7 @@ module.exports = function (sequelize, DataTypes) { type: DataTypes.DATE, }, }, { - tableName: 'users_devides', + tableName: 'users_devices', freezeTableName: true, timestamps: true, }); diff --git a/script-carga-bd-completa.sql b/script-carga-bd-completa.sql index f69703a..ed8fd03 100644 --- a/script-carga-bd-completa.sql +++ b/script-carga-bd-completa.sql @@ -697,13 +697,13 @@ INSERT INTO `users` VALUES ('0939bb2a-d33d-4290-ac81-fc9faa1c015e','+34655112233 UNLOCK TABLES; -- --- Table structure for table `users_devides` +-- Table structure for table `users_devices` -- -DROP TABLE IF EXISTS `users_devides`; +DROP TABLE IF EXISTS `users_devices`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; -CREATE TABLE `users_devides` ( +CREATE TABLE `users_devices` ( `id` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `userId` char(36) CHARACTER SET utf8 COLLATE utf8_bin NOT NULL, `token` varchar(255) DEFAULT NULL, @@ -714,17 +714,17 @@ CREATE TABLE `users_devides` ( `updatedAt` datetime NOT NULL, PRIMARY KEY (`id`), KEY `userId` (`userId`), - CONSTRAINT `users_devides_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE + CONSTRAINT `users_devices_ibfk_1` FOREIGN KEY (`userId`) REFERENCES `users` (`id`) ON DELETE NO ACTION ON UPDATE CASCADE ) ENGINE=InnoDB DEFAULT CHARSET=utf8; /*!40101 SET character_set_client = @saved_cs_client */; -- --- Dumping data for table `users_devides` +-- Dumping data for table `users_devices` -- -LOCK TABLES `users_devides` WRITE; -/*!40000 ALTER TABLE `users_devides` DISABLE KEYS */; -/*!40000 ALTER TABLE `users_devides` ENABLE KEYS */; +LOCK TABLES `users_devices` WRITE; +/*!40000 ALTER TABLE `users_devices` DISABLE KEYS */; +/*!40000 ALTER TABLE `users_devices` ENABLE KEYS */; UNLOCK TABLES; --