Skip to content

Commit

Permalink
unique module key index
Browse files Browse the repository at this point in the history
  • Loading branch information
neustadt committed Jun 26, 2018
1 parent 1f02bac commit 12ee98a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion Resources/sql/install.sql
@@ -1,4 +1,4 @@
CREATE TABLE IF NOT EXISTS `wbm_data_layer_modules` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `module` VARCHAR(255) NOT NULL , `variables` LONGTEXT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;
CREATE TABLE IF NOT EXISTS `wbm_data_layer_modules` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `module` VARCHAR(255) NOT NULL , `variables` LONGTEXT NULL , PRIMARY KEY (`id`) , UNIQUE INDEX `module_UNIQUE` (`module` ASC)) ENGINE = InnoDB;

CREATE TABLE IF NOT EXISTS `wbm_data_layer_properties` ( `id` INT(11) NOT NULL AUTO_INCREMENT , `module` VARCHAR(255) NOT NULL , `parentID` INT(11) NOT NULL DEFAULT '0' , `name` VARCHAR(255) NOT NULL , `value` TEXT NOT NULL , PRIMARY KEY (`id`)) ENGINE = InnoDB;

Expand Down
1 change: 1 addition & 0 deletions Resources/sql/update.3.0.0.sql
@@ -0,0 +1 @@
ALTER TABLE `wbm_data_layer_modules` ADD UNIQUE INDEX `module_UNIQUE` (`module` ASC);
3 changes: 3 additions & 0 deletions WbmTagManager.php
Expand Up @@ -97,6 +97,9 @@ public function update(UpdateContext $context)
}
if (version_compare($currentVersion, '2.1.9', '<')) {
$sql .= file_get_contents($this->getPath() . '/Resources/sql/update.2.1.9.sql');
}
if (version_compare($currentVersion, '3.0.0', '<')) {
$sql .= file_get_contents($this->getPath() . '/Resources/sql/update.3.0.0.sql');
$this->container->get('shopware.db')->query($sql);
}

Expand Down

0 comments on commit 12ee98a

Please sign in to comment.