-
-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1303 from dpfaffenbauer/feature/index-version
[IndexBundle] allow configuring if versions should be indexed or not
- Loading branch information
Showing
15 changed files
with
204 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
@index @index_version | ||
Feature: Adding a object index | ||
In order to make my catalog searchable | ||
I want to create a new index | ||
But when the user saves the object as version, the index should not change | ||
|
||
Background: | ||
Given there is a pimcore class "BooleanTest" | ||
And the definition has a checkbox field "enabled" | ||
And the definition has a checkbox field "booleanTest" | ||
And the definition has a localized input field "name" | ||
And the definitions parent class is set to "\CoreShop\Behat\Model\Index\TestIndex" | ||
And the site has a index "boolean" for behat-class "BooleanTest" with type "mysql" | ||
And the index has following fields: | ||
| key | name | type | getter | columnType | interpreter | | ||
| booleanTest | booleanTest | checkbox | | BOOLEAN | | | ||
And there is an instance of behat-class "BooleanTest" with key "test1" | ||
And the object-instance has following values: | ||
| key | value | type | | ||
| enabled | true | checkbox | | ||
| booleanTest | false | checkbox | | ||
Then the index column "booleanTest" for object-instance "test1" should have value "0" | ||
|
||
Scenario: Save object normally | ||
Given the object-instance has following values: | ||
| key | value | type | | ||
| enabled | true | checkbox | | ||
| booleanTest | true | checkbox | | ||
Then the index column "booleanTest" for object-instance "test1" should have value "1" | ||
|
||
Scenario: Save object as version, index should not update | ||
Given the object-instance has following values as version: | ||
| key | value | type | | ||
| enabled | true | checkbox | | ||
| booleanTest | true | checkbox | | ||
Then the index column "booleanTest" for object-instance "test1" should have value "0" | ||
|
||
Scenario: Save object normally when index allows version changes | ||
Given the index allows version changes | ||
And the object-instance has following values: | ||
| key | value | type | | ||
| enabled | true | checkbox | | ||
| booleanTest | true | checkbox | | ||
Then the index column "booleanTest" for object-instance "test1" should have value "1" | ||
|
||
Scenario: Save object as version when index allows version changes | ||
Given the index allows version changes | ||
And the object-instance has following values as version: | ||
| key | value | type | | ||
| enabled | true | checkbox | | ||
| booleanTest | true | checkbox | | ||
Then the index column "booleanTest" for object-instance "test1" should have value "1" | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/CoreShop/Bundle/CoreBundle/Migrations/Version20200224160300.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace CoreShop\Bundle\CoreBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Pimcore\Migrations\Migration\AbstractPimcoreMigration; | ||
|
||
class Version20200224160300 extends AbstractPimcoreMigration | ||
{ | ||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->addSql(' ALTER TABLE coreshop_index ADD indexLastVersion TINYINT(1) DEFAULT \'0\' NOT NULL;'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
src/CoreShop/Bundle/IndexBundle/Migrations/Version20200224161101.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<?php | ||
|
||
namespace CoreShop\Bundle\IndexBundle\Migrations; | ||
|
||
use Doctrine\DBAL\Schema\Schema; | ||
use Pimcore\Migrations\Migration\AbstractPimcoreMigration; | ||
|
||
class Version20200224161101 extends AbstractPimcoreMigration | ||
{ | ||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function up(Schema $schema) | ||
{ | ||
$this->addSql(' ALTER TABLE coreshop_index ADD indexLastVersion TINYINT(1) DEFAULT \'0\' NOT NULL;'); | ||
} | ||
|
||
/** | ||
* @param Schema $schema | ||
*/ | ||
public function down(Schema $schema) | ||
{ | ||
// this down() migration is auto-generated, please modify it to your needs | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters