Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Neto committed Jun 6, 2024
1 parent c5efc1f commit 6d1e015
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
2 changes: 1 addition & 1 deletion objects/pluginRunDatabaseScript.json.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
if (substr(trim($line), -1, 1) == ';') {
if (!$global['mysqli']->query($templine)) {
$obj->msg = ('Error performing query \'<strong>' . $templine . '\': ' . $global['mysqli']->error . '<br /><br />');
die(json_encode($obj));
die($templine.' '.json_encode($obj));
}
$templine = '';
}
Expand Down
19 changes: 18 additions & 1 deletion plugin/Cache/install/install.sql
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
-- Drop the table if it exists
DROP TABLE IF EXISTS `CachesInDB`;

-- Create the table
CREATE TABLE IF NOT EXISTS `CachesInDB` (
`id` INT NOT NULL AUTO_INCREMENT,
`created` DATETIME NULL,
Expand All @@ -20,16 +22,31 @@ CREATE TABLE IF NOT EXISTS `CachesInDB` (
INDEX `caches4` (`user_location` ASC),
INDEX `caches9` (`name` ASC))
ENGINE = InnoDB;

ALTER TABLE CachesInDB ADD FULLTEXT(name);

-- Identify and remove duplicates
DELETE t1 FROM `CachesInDB` t1
INNER JOIN `CachesInDB` t2
WHERE
t1.id < t2.id AND
t1.`name` = t2.`name` AND
t1.`domain` = t2.`domain` AND
t1.`ishttps` = t2.`ishttps` AND
t1.`user_location` = t2.`user_location` AND
t1.`loggedType` = t2.`loggedType`;

-- Add the unique index
ALTER TABLE CachesInDB
ADD UNIQUE `unique_cache_index`(`name`(250), `domain`(50), `ishttps`, `user_location`(50), `loggedType`);

-- Drop the cache_schedule_delete table if it exists
DROP TABLE IF EXISTS `cache_schedule_delete`;

-- Create the cache_schedule_delete table
CREATE TABLE IF NOT EXISTS `cache_schedule_delete` (
`id` INT NOT NULL AUTO_INCREMENT,
`name` VARCHAR(500) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `name_UNIQUE` (`name` ASC))
ENGINE = InnoDB;
ENGINE = InnoDB;

0 comments on commit 6d1e015

Please sign in to comment.