Load modules by position

This commit is contained in:
Jérôme Billiras
2014-04-23 16:33:01 +02:00
parent 292a2c7a50
commit 5197afb87d
4 changed files with 18 additions and 1 deletions

View File

@@ -25,6 +25,7 @@ class ModuleQuery extends BaseModuleQuery
if (null === self::$activated) {
self::$activated = self::create()
->filterByActivate(1)
->orderByPosition()
->find();
}

View File

@@ -728,6 +728,9 @@
<column name="chapo" type="LONGVARCHAR" />
<column name="postscriptum" type="LONGVARCHAR" />
<column name="full_namespace" size="255" type="VARCHAR" />
<index name="idx_module_position">
<index-column name="position" />
</index>
<unique name="code_UNIQUE">
<unique-column name="code" />
</unique>

View File

@@ -866,7 +866,8 @@ CREATE TABLE `module`
`created_at` DATETIME,
`updated_at` DATETIME,
PRIMARY KEY (`id`),
UNIQUE INDEX `code_UNIQUE` (`code`)
UNIQUE INDEX `code_UNIQUE` (`code`),
INDEX `idx_module_position` (`position`)
) ENGINE=InnoDB CHARACTER SET='utf8';
-- ---------------------------------------------------------------------

12
setup/update/2.0.1.sql Normal file
View File

@@ -0,0 +1,12 @@
# This is a fix for InnoDB in MySQL >= 4.1.x
# It "suspends judgement" for fkey relationships until are tables are set.
SET FOREIGN_KEY_CHECKS = 0;
UPDATE `config` SET `value`='2.0.1' WHERE `name`='thelia_version';
UPDATE `config` SET `value`='' WHERE `name`='thelia_extra_version';
ALTER TABLE `module` ADD INDEX `idx_module_position` (`position`);
SET FOREIGN_KEY_CHECKS = 1;