diff --git a/lib/SP/Services/Install/Installer.php b/lib/SP/Services/Install/Installer.php index 9d747178..40c9b4ad 100644 --- a/lib/SP/Services/Install/Installer.php +++ b/lib/SP/Services/Install/Installer.php @@ -57,7 +57,7 @@ final class Installer extends Service */ const VERSION = [3, 0, 0]; const VERSION_TEXT = '3.0-beta'; - const BUILD = 18090903; + const BUILD = 18091101; /** * @var DatabaseSetupInterface diff --git a/lib/SP/Services/Install/MySQL.php b/lib/SP/Services/Install/MySQL.php index 6e3191d0..8e9aeeec 100644 --- a/lib/SP/Services/Install/MySQL.php +++ b/lib/SP/Services/Install/MySQL.php @@ -207,7 +207,7 @@ final class MySQL implements DatabaseSetupInterface try { $dbc = $this->mysqlHandler->getConnectionSimple(); - $dbc->exec('CREATE SCHEMA `' . $this->installData->getDbName() . '` DEFAULT CHARACTER SET utf8 COLLATE utf8_general_ci'); + $dbc->exec('CREATE SCHEMA `' . $this->installData->getDbName() . '` DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci'); } catch (PDOException $e) { throw new SPException( sprintf(__('Error al crear la BBDD (\'%s\')'), $e->getMessage()), diff --git a/lib/SP/Services/Upgrade/UpgradeAppService.php b/lib/SP/Services/Upgrade/UpgradeAppService.php index e323437e..7a2342d3 100644 --- a/lib/SP/Services/Upgrade/UpgradeAppService.php +++ b/lib/SP/Services/Upgrade/UpgradeAppService.php @@ -54,6 +54,7 @@ final class UpgradeAppService extends Service implements UpgradeInterface * @param ConfigData $configData * * @throws UpgradeException + * @throws \SP\Storage\File\FileException */ public function upgrade($version, ConfigData $configData) { diff --git a/lib/SP/Services/Upgrade/UpgradeDatabaseService.php b/lib/SP/Services/Upgrade/UpgradeDatabaseService.php index 649bdda7..05c2f931 100644 --- a/lib/SP/Services/Upgrade/UpgradeDatabaseService.php +++ b/lib/SP/Services/Upgrade/UpgradeDatabaseService.php @@ -30,7 +30,6 @@ use SP\Core\Events\EventMessage; use SP\Services\Service; use SP\Storage\Database\Database; use SP\Storage\Database\MySQLFileParser; -use SP\Storage\Database\QueryData; use SP\Storage\File\FileException; use SP\Storage\File\FileHandler; use SP\Util\Version; @@ -45,7 +44,14 @@ final class UpgradeDatabaseService extends Service implements UpgradeInterface /** * @var array Versiones actualizables */ - const UPGRADES = ['300.18010101', '300.18072302', '300.18072501', '300.18083001', '300.18083002']; + const UPGRADES = [ + '300.18010101', + '300.18072302', + '300.18072501', + '300.18083001', + '300.18083002', + '300.18091101' + ]; /** * @var Database @@ -67,7 +73,7 @@ final class UpgradeDatabaseService extends Service implements UpgradeInterface /** * Inicia el proceso de actualización de la BBDD. * - * @param int $version con la versión de la BBDD actual + * @param int $version con la versión de la BBDD actual * @param ConfigData $configData * * @return bool @@ -107,18 +113,6 @@ final class UpgradeDatabaseService extends Service implements UpgradeInterface } } -// foreach (self::AUX_UPGRADES as $auxVersion) { -// if (Util::checkVersion($version, $auxVersion) -// && $this->auxUpgrades($auxVersion) === false -// ) { -// throw new UpgradeException( -// __u('Error al aplicar la actualización auxiliar'), -// UpgradeException::CRITICAL, -// __u('Compruebe el registro de eventos para más detalles') -// ); -// } -// } - $this->eventDispatcher->notifyEvent('upgrade.db.end', new Event($this, EventMessage::factory() ->addDescription(__u('Actualizar BBDD'))) @@ -165,12 +159,13 @@ final class UpgradeDatabaseService extends Service implements UpgradeInterface ->addDetail(__u('Versión'), $version)) ); - $queryData = new QueryData(); - $queryData->setQuery($query); - - $this->db->doQuery($queryData); + // Direct PDO handling + $this->db->getDbHandler() + ->getConnection() + ->exec($query); } catch (\Exception $e) { processException($e); + logger('SQL: ' . $query); $this->eventDispatcher->notifyEvent('exception', diff --git a/lib/SP/Storage/Database/Database.php b/lib/SP/Storage/Database/Database.php index 893639a1..5887e6b7 100644 --- a/lib/SP/Storage/Database/Database.php +++ b/lib/SP/Storage/Database/Database.php @@ -214,11 +214,13 @@ final class Database implements DatabaseInterface try { $connection = $this->dbHandler->getConnection(); - if (is_array($queryData->getParams())) { + $params = $queryData->getParams(); + + if (!empty($params)) { $stmt = $connection->prepare($query); $paramIndex = 0; - foreach ($queryData->getParams() as $param => $value) { + foreach ($params as $param => $value) { if ($isCount === true && $queryData->getLimit() !== '' && $paramIndex > $paramMaxIndex diff --git a/schemas/30018010101.sql b/schemas/30018010101.sql index c662f134..612564d7 100644 --- a/schemas/30018010101.sql +++ b/schemas/30018010101.sql @@ -1,25 +1,28 @@ DELIMITER $$ + SET FOREIGN_KEY_CHECKS = 0 $$ +ALTER SCHEMA DEFAULT COLLATE utf8_unicode_ci $$ + DROP PROCEDURE IF EXISTS drop_primary $$ - + CREATE PROCEDURE drop_primary( tName VARCHAR(64) ) BEGIN - DECLARE cName VARCHAR(64); + DECLARE cName VARCHAR(64); DECLARE done INT DEFAULT FALSE; DECLARE cur CURSOR FOR - SELECT DISTINCT + SELECT DISTINCT COLUMN_NAME - FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE - WHERE TABLE_SCHEMA = DATABASE() - AND CONSTRAINT_NAME = 'PRIMARY' - AND TABLE_NAME = tName; + FROM INFORMATION_SCHEMA.KEY_COLUMN_USAGE + WHERE TABLE_SCHEMA = DATABASE() + AND CONSTRAINT_NAME = 'PRIMARY' + AND TABLE_NAME = tName COLLATE utf8_unicode_ci; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; - + read_loop: LOOP FETCH cur INTO cName; @@ -35,9 +38,9 @@ CREATE PROCEDURE drop_primary( CLOSE cur; END $$ - + DROP PROCEDURE IF EXISTS remove_constraints $$ - + CREATE PROCEDURE remove_constraints() BEGIN DECLARE done INT DEFAULT FALSE; @@ -69,7 +72,7 @@ CREATE PROCEDURE remove_constraints() CLOSE cur; END $$ - + DROP PROCEDURE IF EXISTS remove_indexes $$ CREATE PROCEDURE remove_indexes() @@ -83,7 +86,7 @@ CREATE PROCEDURE remove_indexes() INDEX_NAME FROM INFORMATION_SCHEMA.STATISTICS WHERE TABLE_SCHEMA = DATABASE() - AND NON_UNIQUE = 1; + AND NON_UNIQUE = 1; DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE; OPEN cur; @@ -102,7 +105,7 @@ CREATE PROCEDURE remove_indexes() END LOOP; CLOSE cur; - END $$ + END $$ CALL remove_constraints() $$ CALL remove_indexes() $$ @@ -135,7 +138,7 @@ ALTER TABLE customFieldsData ADD INDEX idx_CustomFieldData_01 (definitionId ASC), ADD INDEX idx_CustomFieldData_02 (itemId ASC, moduleId ASC), ADD INDEX idx_CustomFieldData_03 (moduleId ASC), - ADD INDEX uk_CustomFieldData_01 (moduleId ASC, itemId ASC, definitionId ASC), + COLLATE utf8_unicode_ci, RENAME TO CustomFieldData $$ -- CustomFieldDefinition @@ -150,6 +153,7 @@ ALTER TABLE customFieldsDef CHANGE customfielddef_id id INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE customfielddef_module moduleId SMALLINT(5) UNSIGNED NOT NULL, CHANGE customfielddef_field field BLOB NULL, + COLLATE utf8_unicode_ci, RENAME TO CustomFieldDefinition $$ -- EventLog @@ -162,6 +166,7 @@ ALTER TABLE log CHANGE log_action action VARCHAR(50) NOT NULL, CHANGE log_description description TEXT, CHANGE log_level level VARCHAR(20) NOT NULL, + COLLATE utf8_unicode_ci, RENAME TO EventLog $$ -- Track @@ -174,6 +179,7 @@ ALTER TABLE track CHANGE track_ipv6 ipv6 BINARY(16), ADD INDEX `idx_Track_01` (userId ASC), ADD INDEX `idx_Track_02` (time ASC, ipv4 ASC, ipv6 ASC, source ASC), + COLLATE utf8_unicode_ci, RENAME TO Track $$ -- AccountFile @@ -187,6 +193,7 @@ ALTER TABLE accFiles CHANGE accfile_extension extension VARCHAR(10) NOT NULL, CHANGE accFile_thumb thumb MEDIUMBLOB, ADD INDEX idx_AccountFile_01 (accountId ASC), + COLLATE utf8_unicode_ci, RENAME TO AccountFile $$ -- Fix NULL user's hash salt @@ -222,6 +229,7 @@ ALTER TABLE usrData CHANGE user_preferences preferences BLOB, ADD INDEX idx_User_01 (pass ASC), ADD UNIQUE INDEX `uk_User_01` (`login`, `ssoLogin`), + COLLATE utf8_unicode_ci, RENAME TO User $$ -- UserProfile @@ -229,6 +237,7 @@ ALTER TABLE usrProfiles CHANGE userprofile_id id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE userprofile_name name VARCHAR(45) NOT NULL, CHANGE userProfile_profile profile BLOB NOT NULL, + COLLATE utf8_unicode_ci, RENAME TO UserProfile $$ -- Notice @@ -244,6 +253,7 @@ ALTER TABLE notices CHANGE notice_onlyAdmin onlyAdmin TINYINT(1) DEFAULT 0, ADD INDEX idx_Notification_01 (userId ASC, checked ASC, date ASC), ADD INDEX idx_Notification_02 (component ASC, date ASC, checked ASC, userId ASC), + COLLATE utf8_unicode_ci, RENAME TO Notification $$ -- Plugin @@ -254,6 +264,7 @@ ALTER TABLE `plugins` CHANGE plugin_enabled enabled TINYINT(1) NOT NULL DEFAULT 0, ADD available TINYINT(1) DEFAULT 0, ADD UNIQUE INDEX uk_Plugin_01 (name ASC), + COLLATE utf8_unicode_ci, RENAME TO Plugin $$ -- PublicLink @@ -283,12 +294,13 @@ ALTER TABLE publicLinks CHANGE publicLink_linkData `data` LONGBLOB, ADD UNIQUE INDEX uk_PublicLink_01 (`hash` ASC), ADD UNIQUE INDEX uk_PublicLink_02 (itemId ASC), + COLLATE utf8_unicode_ci, RENAME TO PublicLink $$ -- Fix missing categories hash UPDATE categories SET category_hash = MD5(CONCAT(category_id, category_name)) -WHERE category_hash IS NULL OR category_hash = 0 $$ +WHERE category_hash IS NULL OR category_hash = '0' $$ -- Category ALTER TABLE categories @@ -297,6 +309,7 @@ ALTER TABLE categories CHANGE category_hash hash VARBINARY(40) NOT NULL, CHANGE category_description description VARCHAR(255), ADD UNIQUE INDEX uk_Category_01 (`hash` ASC), + COLLATE utf8_unicode_ci, RENAME TO Category $$ -- Config @@ -304,6 +317,7 @@ ALTER TABLE config CHANGE config_parameter parameter VARCHAR(50) NOT NULL, CHANGE config_value VALUE VARCHAR(4000), ADD PRIMARY KEY (parameter), + COLLATE utf8_unicode_ci, RENAME TO Config $$ -- Fix missing customers hash @@ -319,6 +333,7 @@ ALTER TABLE customers CHANGE customer_description description VARCHAR(255), ADD `isGlobal` TINYINT(1) DEFAULT 0, ADD INDEX uk_Client_01 (`hash` ASC), + COLLATE utf8_unicode_ci, RENAME TO Client $$ -- Account @@ -350,6 +365,7 @@ ALTER TABLE accounts ADD INDEX idx_Account_02 (`userGroupId` ASC, `userId` ASC), ADD INDEX idx_Account_03 (`clientId` ASC), ADD INDEX idx_Account_04 (`parentId` ASC), + COLLATE utf8_unicode_ci, RENAME TO Account $$ -- AccountToFavorite @@ -357,6 +373,7 @@ ALTER TABLE accFavorites CHANGE accfavorite_accountId accountId MEDIUMINT UNSIGNED NOT NULL, CHANGE accfavorite_userId userId SMALLINT(5) UNSIGNED NOT NULL, ADD INDEX idx_AccountToFavorite_01 (accountId ASC, userId ASC), + COLLATE utf8_unicode_ci, RENAME TO AccountToFavorite $$ -- AccountHistory @@ -390,6 +407,7 @@ ALTER TABLE accHistory CHANGE accHistory_isPrivateGroup isPrivateGroup TINYINT(1) DEFAULT 0, ADD INDEX idx_AccountHistory_01 (accountId ASC), ADD INDEX idx_AccountHistory_02 (parentId ASC), + COLLATE utf8_unicode_ci, RENAME TO AccountHistory $$ @@ -405,12 +423,14 @@ ALTER TABLE tags CHANGE tag_hash hash VARBINARY(40) NOT NULL, ADD UNIQUE INDEX uk_Tag_01 (`hash` ASC), ADD INDEX idx_Tag_01 (`name` ASC), + COLLATE utf8_unicode_ci, RENAME TO Tag $$ -- AccountToTag ALTER TABLE accTags CHANGE acctag_accountId accountId MEDIUMINT UNSIGNED NOT NULL, CHANGE acctag_tagId tagId INT(10) UNSIGNED NOT NULL, + COLLATE utf8_unicode_ci, RENAME TO AccountToTag $$ -- AccountToUserGroup @@ -419,6 +439,7 @@ ALTER TABLE accGroups CHANGE accgroup_accountId accountId MEDIUMINT UNSIGNED NOT NULL, CHANGE accgroup_groupId userGroupId SMALLINT(5) UNSIGNED NOT NULL, ADD INDEX idx_AccountToUserGroup_01 (`accountId` ASC), + COLLATE utf8_unicode_ci, RENAME TO AccountToUserGroup $$ -- AccountToUser @@ -427,6 +448,7 @@ ALTER TABLE accUsers CHANGE accuser_accountId accountId MEDIUMINT UNSIGNED NOT NULL, CHANGE accuser_userId userId SMALLINT(5) UNSIGNED NOT NULL, ADD INDEX idx_AccountToUser_01 (accountId ASC), + COLLATE utf8_unicode_ci, RENAME TO AccountToUser $$ -- UserToUserGroup @@ -434,6 +456,7 @@ ALTER TABLE usrToGroups CHANGE usertogroup_userId userId SMALLINT(5) UNSIGNED NOT NULL, CHANGE usertogroup_groupId userGroupId SMALLINT(5) UNSIGNED NOT NULL, ADD INDEX idx_UserToUserGroup_01 (userId ASC), + COLLATE utf8_unicode_ci, RENAME TO UserToUserGroup $$ -- UserGroup @@ -441,6 +464,7 @@ ALTER TABLE usrGroups CHANGE usergroup_id id SMALLINT(5) UNSIGNED NOT NULL AUTO_INCREMENT, CHANGE usergroup_name name VARCHAR(50) NOT NULL, CHANGE usergroup_description description VARCHAR(255), + COLLATE utf8_unicode_ci, RENAME TO UserGroup $$ -- AuthToken @@ -455,6 +479,7 @@ ALTER TABLE authTokens CHANGE authtoken_hash hash VARBINARY(1000), ADD UNIQUE INDEX uk_AuthToken_01 (token ASC, actionId ASC), ADD INDEX idx_AuthToken_01 (userId ASC, actionId ASC, token ASC), + COLLATE utf8_unicode_ci, RENAME TO AuthToken $$ -- UserPassRecover @@ -465,6 +490,7 @@ ALTER TABLE usrPassRecover CHANGE userpassr_date date INT(10) UNSIGNED NOT NULL, CHANGE userpassr_used used TINYINT(1) DEFAULT 0, ADD INDEX idx_UserPassRecover_01 (userId ASC, date ASC), + COLLATE utf8_unicode_ci, RENAME TO UserPassRecover $$ -- Views diff --git a/schemas/30018091101.sql b/schemas/30018091101.sql new file mode 100644 index 00000000..fb027064 --- /dev/null +++ b/schemas/30018091101.sql @@ -0,0 +1,52 @@ +DELIMITER $$ + +ALTER SCHEMA DEFAULT COLLATE utf8_unicode_ci $$ + +ALTER TABLE Account + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountFile + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountHistory + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountToFavorite + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountToTag + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountToUser + COLLATE utf8_unicode_ci $$ +ALTER TABLE AccountToUserGroup + COLLATE utf8_unicode_ci $$ +ALTER TABLE AuthToken + COLLATE utf8_unicode_ci $$ +ALTER TABLE Category + COLLATE utf8_unicode_ci $$ +ALTER TABLE Client + COLLATE utf8_unicode_ci $$ +ALTER TABLE Config + COLLATE utf8_unicode_ci $$ +ALTER TABLE CustomFieldData + COLLATE utf8_unicode_ci $$ +ALTER TABLE CustomFieldDefinition + COLLATE utf8_unicode_ci $$ +ALTER TABLE CustomFieldType + COLLATE utf8_unicode_ci $$ +ALTER TABLE EventLog + COLLATE utf8_unicode_ci $$ +ALTER TABLE Notification + COLLATE utf8_unicode_ci $$ +ALTER TABLE Plugin + COLLATE utf8_unicode_ci $$ +ALTER TABLE PublicLink + COLLATE utf8_unicode_ci $$ +ALTER TABLE Tag + COLLATE utf8_unicode_ci $$ +ALTER TABLE Track + COLLATE utf8_unicode_ci $$ +ALTER TABLE User + COLLATE utf8_unicode_ci $$ +ALTER TABLE UserPassRecover + COLLATE utf8_unicode_ci $$ +ALTER TABLE UserProfile + COLLATE utf8_unicode_ci $$ +ALTER TABLE UserToUserGroup + COLLATE utf8_unicode_ci $$ \ No newline at end of file diff --git a/schemas/dbstructure.sql b/schemas/dbstructure.sql index 9136e0f7..e2fdacdd 100644 --- a/schemas/dbstructure.sql +++ b/schemas/dbstructure.sql @@ -49,7 +49,7 @@ CREATE TABLE `Account` ( CONSTRAINT `fk_Account_userId` FOREIGN KEY (`userId`) REFERENCES `User` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `ItemPreset`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -81,7 +81,7 @@ CREATE TABLE `ItemPreset` PRIMARY KEY (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountFile`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -102,7 +102,7 @@ CREATE TABLE `AccountFile` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountHistory`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -150,7 +150,7 @@ CREATE TABLE `AccountHistory` ( CONSTRAINT `fk_AccountHistory_userId` FOREIGN KEY (`userId`) REFERENCES `User` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountToFavorite`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -169,7 +169,7 @@ CREATE TABLE `AccountToFavorite` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountToTag`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -188,7 +188,7 @@ CREATE TABLE `AccountToTag` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountToUser`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -208,7 +208,7 @@ CREATE TABLE `AccountToUser` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AccountToUserGroup`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -228,7 +228,7 @@ CREATE TABLE `AccountToUserGroup` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `AuthToken`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -251,7 +251,7 @@ CREATE TABLE `AuthToken` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Category`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -265,7 +265,7 @@ CREATE TABLE `Category` ( UNIQUE KEY `uk_Category_01` (`hash`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Client`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -280,7 +280,7 @@ CREATE TABLE `Client` ( KEY `uk_Client_01` (`hash`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Config`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -291,7 +291,7 @@ CREATE TABLE `Config` ( PRIMARY KEY (`parameter`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `CustomFieldData`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -311,7 +311,7 @@ CREATE TABLE `CustomFieldData` ( CONSTRAINT `fk_CustomFieldData_definitionId` FOREIGN KEY (`definitionId`) REFERENCES `CustomFieldDefinition` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `CustomFieldDefinition`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -331,7 +331,7 @@ CREATE TABLE `CustomFieldDefinition` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `CustomFieldType`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -344,7 +344,7 @@ CREATE TABLE `CustomFieldType` ( UNIQUE KEY `uk_CustomFieldType_01` (`name`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `EventLog`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -361,7 +361,7 @@ CREATE TABLE `EventLog` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; INSERT INTO CustomFieldType (id, name, text) VALUES (1, 'text', 'Texto'), (2, 'password', 'Clave'), (3, 'date', 'Fecha'), (4, 'number', 'Número'), @@ -387,7 +387,7 @@ CREATE TABLE `Notification` ( CONSTRAINT `fk_Notification_userId` FOREIGN KEY (`userId`) REFERENCES `User` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Plugin`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -402,7 +402,7 @@ CREATE TABLE `Plugin` ( UNIQUE KEY `uk_Plugin_01` (`name`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `PublicLink`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -429,7 +429,7 @@ CREATE TABLE `PublicLink` ( CONSTRAINT `fk_PublicLink_userId` FOREIGN KEY (`userId`) REFERENCES `User` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Tag`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -443,7 +443,7 @@ CREATE TABLE `Tag` ( KEY `idx_Tag_01` (`name`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `Track`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -460,7 +460,7 @@ CREATE TABLE `Track` ( KEY `idx_Track_02` (`time`, `ipv4`, `ipv6`, `source`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `User`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -499,7 +499,7 @@ CREATE TABLE `User` ( CONSTRAINT `fk_User_userProfileId` FOREIGN KEY (`userProfileId`) REFERENCES `UserProfile` (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `UserGroup`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -511,7 +511,7 @@ CREATE TABLE `UserGroup` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `UserPassRecover`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -529,7 +529,7 @@ CREATE TABLE `UserPassRecover` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `UserProfile`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -541,7 +541,7 @@ CREATE TABLE `UserProfile` ( PRIMARY KEY (`id`) ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `UserToUserGroup`; /*!40101 SET @saved_cs_client = @@character_set_client */; @@ -560,7 +560,7 @@ CREATE TABLE `UserToUserGroup` ( ON UPDATE CASCADE ) ENGINE = InnoDB - DEFAULT CHARSET = utf8; + DEFAULT CHARSET = utf8 COLLATE utf8_unicode_ci; /*!40101 SET character_set_client = @saved_cs_client */; DROP TABLE IF EXISTS `account_data_v`; /*!50001 DROP VIEW IF EXISTS `account_data_v`*/;