SQL Inventory

List of all SQL mentioned in the code..

ValueCountFile:Line
"UPDATE attribute SET type='array' WHERE type='arrayMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE product_attribute_value SET deleted=1 WHERE attribute_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
'UPDATE ' $table ' SET image_id = null WHERE image_id = :id'
1
  • /app/Listeners/AssetEntity.php
"SELECT channel_id, is_active AS isActive FROM product_channel pc WHERE product_id = '{$productId}' AND pc.deleted = 0"
1
  • /app/Listeners/ProductController.php
"UPDATE asset_relation SET role = '{$roles}' WHERE id = '{$relation['id']}';"
1
  • /app/Listeners/AssetRelationEntity.php
"SELECT {$select}
                    FROM asset_relation ar
                         LEFT JOIN asset a ON ar.asset_id = a.id
                         LEFT JOIN asset_relation_channel arc ON arc.asset_relation_id = ar.id AND arc.deleted = 0
                    WHERE ar.entity_id = '
{$relation->get('entityId')}'
                        AND ar.entity_name = '
{$relation->get('entityName')}'
                        AND ar.role LIKE '%\"
{$role}\"%'
                        AND a.type = '
{$type}'
                        AND ar.scope = '
{$scope}'
                        AND ar.id <> '
{$relation->get('id')}'
                        AND ar.deleted = '0'"
1
  • /app/Listeners/AssetRelationEntity.php
"SELECT id FROM association WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE associated_product SET deleted=1 WHERE association_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM association WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM attribute WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_family_attribute SET deleted=1 WHERE attribute_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM attribute WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"INSERT INTO product_attribute_value (id,scope,product_id,attribute_id,product_family_attribute_id,created_by_id,created_at,owner_user_id,assigned_user_id,attribute_type,locale,is_required,locale_parent_id,value) VALUES ('$id','$scope','$productId','$attributeId','$pfaId','$createdById','$createdAt','$ownerUserId','$assignedUserId','$type',$locale,$isRequired,@localeParentId,@localeParentValue)"
1
  • /app/Repositories/ProductFamilyAttribute.php
"DELETE FROM attribute_group WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM brand WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM catalog WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM category WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_category SET deleted=1 WHERE category_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM category WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM channel WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_attribute_value_channel SET deleted=1 WHERE channel_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_category_channel SET deleted=1 WHERE channel_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"INSERT INTO entity_team (entity_id, team_id, entity_type) VALUES ('$id','$teamId','ProductAttributeValue')"
1
  • /app/Repositories/ProductFamilyAttribute.php
"DELETE FROM product_attribute_value_channel WHERE product_attribute_value_id IN ('" implode("','"$ids) . "')"
1
  • /app/Repositories/ProductFamilyAttribute.php
"DELETE FROM channel WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE attribute SET deleted=1 WHERE parent_id='$id' AND locale IS NOT NULL"
1
  • /app/Repositories/Attribute.php
"INSERT INTO product_image_channel (id,product_id,product_image_id,channel_id) VALUES ('" Util::generateId( ) . "', '" $image['productId'] . "', '" $newImage->get('id') . "', '" $row['channelId'] . "')"
1
  • /app/Migrations/V3Dot10Dot0.php
"SELECT category_id FROM catalog_category WHERE catalog_id=(SELECT catalog_id FROM product WHERE id=:product_id AND deleted=0) ANd deleted=0"
1
  • /app/Repositories/Product.php
"SELECT DISTINCT c.id
                 FROM category c
                   LEFT JOIN category c1 ON c1.category_parent_id=c.id AND c1.deleted=0
                 WHERE c.deleted=0
                   AND c1.id IS NULL
                   AND c.id NOT IN (SELECT category_id FROM product_category_linker WHERE product_id=:product_id AND deleted=0)
                   AND (
$whereTree)"
1
  • /app/Repositories/Product.php
"UPDATE product_attribute_value SET deleted=1 WHERE locale_parent_id=:id"
1
  • /app/Repositories/ProductAttributeValue.php
"SELECT pcl.id 
                     FROM product_category_linker pcl 
                         JOIN product p ON p.id=pcl.product_id AND p.deleted=0 
                         JOIN category c ON c.id=pcl.category_id AND c.deleted=0 
                     WHERE pcl.deleted=0 
                       AND p.catalog_id=:id 
                       AND c.category_route LIKE :likeRoute"
1
  • /app/Repositories/Catalog.php
"UPDATE product_category_linker SET deleted=1 WHERE id IN ('" implode("','"$ids) . "')"
1
  • /app/Repositories/Catalog.php
"UPDATE product SET deleted=1 WHERE catalog_id='$id'"
1
  • /app/Repositories/Catalog.php
"UPDATE product_category_linker SET sorting=:sorting WHERE sorting IS NULL AND deleted=0"
1
  • /app/Repositories/Category.php
"SELECT DISTINCT p.id
                 FROM catalog_category cc
                   LEFT JOIN product p ON p.catalog_id=cc.catalog_id AND p.deleted=0
                 WHERE cc.deleted=0
                   AND cc.category_id=:treeId
                   AND p.id NOT IN (SELECT product_id FROM product_category_linker WHERE category_id=:id AND deleted=0)"
1
  • /app/Repositories/Category.php
"SELECT MAX(sort_order) AS max FROM attribute WHERE deleted=0"
1
  • /app/Repositories/Attribute.php
"UPDATE product_attribute_value SET is_required=$isRequired,scope='$scope' WHERE product_family_attribute_id='$pfaId' AND deleted=0"
1
  • /app/Repositories/ProductFamilyAttribute.php
"UPDATE attribute SET deleted=1 WHERE parent_id='$id'"
1
  • /app/Repositories/Attribute.php
"UPDATE attribute SET attribute_group_id=$attributeGroupId WHERE parent_id='$id'"
1
  • /app/Repositories/Attribute.php
"UPDATE attribute SET sort_order='$max' WHERE id='$id';"
1
  • /app/Repositories/Attribute.php
"UPDATE attribute SET attribute_group_id='$id' WHERE parent_id='$parentId' AND locale IS NOT NULL"
1
  • /app/Repositories/AttributeGroup.php
"UPDATE attribute SET attribute_group_id=null WHERE parent_id='$parentId' AND locale IS NOT NULL"
1
  • /app/Repositories/AttributeGroup.php
"UPDATE product_attribute_value SET product_family_attribute_id=NULL,is_required=0 WHERE product_family_attribute_id='$id'"
1
  • /app/Repositories/ProductFamilyAttribute.php
"UPDATE product_attribute_value SET product_family_attribute_id='$pfaId',is_required=$isRequired,scope='$scope' WHERE id='$id'"
1
  • /app/Repositories/ProductFamilyAttribute.php
"UPDATE product_attribute_value SET deleted=1 WHERE id='$id'"
1
  • /app/Repositories/ProductFamilyAttribute.php
"DELETE FROM product_attribute_value_channel WHERE product_attribute_value_id='$id'"
1
  • /app/Repositories/ProductFamilyAttribute.php
"DELETE FROM product_attribute_value_channel WHERE product_attribute_value_id='$id' AND channel_id='$itemChannel'"
1
  • /app/Repositories/ProductFamilyAttribute.php
"UPDATE product_family_attribute_channel SET deleted=1 WHERE channel_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM country WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE attribute SET type='varchar', is_multilang=1 WHERE type='varcharMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"SELECT id FROM product_attribute_value WHERE product_id='$productId'"
1
  • /app/Services/Product.php
"UPDATE channel SET locales=NULL WHERE 1"
1
  • /app/Listeners/SettingsController.php
"UPDATE attribute SET deleted=1 WHERE locale IS NOT NULL;UPDATE product_family_attribute SET deleted=1 WHERE locale IS NOT NULL;UPDATE product_attribute_value SET deleted=1 WHERE locale IS NOT NULL"
1
  • /app/Listeners/SettingsController.php
"UPDATE attribute SET deleted=1 WHERE locale IN ('$localesStr');UPDATE product_family_attribute SET deleted=1 WHERE locale IN ('$localesStr');UPDATE product_attribute_value SET deleted=1 WHERE locale IN ('$localesStr')"
1
  • /app/Listeners/SettingsController.php
"SELECT id FROM attribute WHERE type IN ('varchar','text','wysiwyg') AND deleted=0"
1
  • /app/SelectManagers/Product.php
"SELECT product_id FROM product_attribute_value WHERE deleted=0 AND attribute_id IN ('" implode("','"$attributesIds) . "') AND (value LIKE '%$textFilter%')"
1
  • /app/SelectManagers/Product.php
'SELECT id AS productId
                FROM product
                WHERE deleted = 0 
                      AND brand_id = :brandId'
1
  • /app/SelectManagers/Product.php
'SELECT id AS productId
                FROM product
                WHERE deleted = 0
                      AND product_family_id = :productFamilyId'
1
  • /app/SelectManagers/Product.php
"SELECT id FROM category WHERE (id='$id' OR category_route LIKE '%|$id|%') AND deleted=0"
1
  • /app/SelectManagers/Product.php
"SELECT id
                     FROM channel
                     WHERE deleted=0
                       AND id IN (SELECT channel_id FROM product_channel WHERE product_id=:productId AND deleted=0)
                       AND id NOT IN (SELECT channel_id FROM product_attribute_value_channel WHERE deleted=0 AND product_attribute_value_id IN (SELECT id FROM product_attribute_value WHERE deleted=0 AND product_id=:productId AND attribute_id=:attributeId))"
1
  • /app/SelectManagers/Channel.php
"
                DELETE FROM product_attribute_value_channel WHERE product_attribute_value_id IN ('
{$ids}');
                DELETE FROM product_attribute_value WHERE id IN ('
{$ids}');
            "
1
  • /app/Services/Product.php
"DELETE FROM product_serie WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT {$selectFields}
                FROM associated_product AS ap
                  JOIN product AS relatedProduct 
                    ON relatedProduct.id = ap.related_product_id AND relatedProduct.deleted = 0
                  JOIN product AS p_main 
                    ON p_main.id = ap.main_product_id AND p_main.deleted = 0
                  JOIN association 
                    ON association.id = ap.association_id AND association.deleted = 0
                WHERE ap.deleted = 0 
                  AND ap.main_product_id = :id AND relatedProduct.type IN ('
{$stringTypes}') " $wherePart "ORDER BY " $sortColumn " " $sortOrder $limit
1
  • /app/Services/Product.php
'UPDATE product_category_linker SET sorting=:sorting WHERE category_id=:categoryId AND product_id=:productId AND deleted=0'
1
  • /app/Services/Product.php
"SELECT id FROM product_category_linker WHERE sorting>=:sorting AND category_id=:categoryId AND deleted=0 AND product_id!=:productId ORDER BY sorting"
1
  • /app/Services/Product.php
"UPDATE product_category_linker SET sorting='$max' WHERE id='$id';"
1
  • /app/Services/Product.php
"UPDATE product SET brand_id = null WHERE brand_id IN ('%s');"
1
  • /app/Services/Brand.php
'SELECT 
                   pf.id        AS productFamilyId,
                   pf.name      AS productFamilyName,
                   a.id         AS attributeId,
                   a.name       AS attributeName,
                   a.type       AS attributeType,
                   a.type_value AS attributeTypeValue
                FROM attribute AS a
                LEFT JOIN product_family_attribute AS pfa ON a.id = pfa.attribute_id AND pfa.deleted = 0
                LEFT JOIN product_family AS pf ON pf.id = pfa.product_family_id  AND pf.deleted = 0
                WHERE a.deleted=0 
                  AND a.id IN (SELECT attribute_id FROM product_attribute_value WHERE deleted=0)'
1
  • /app/Services/Attribute.php
"UPDATE {$nameTable} linker 
                        SET is_active = :isActive
                        WHERE 
{$fieldForeign} = :entityId AND channel_id = :channelId AND deleted = {$deleted}"
1
  • /app/Services/Channel.php
"SELECT " $select 
                FROM product as p 
                WHERE p.image_id IS NULL 
                  AND p.deleted = 0 
                  AND p.type IN " 
$this->getProductTypesCondition( )
1
  • /app/Services/GeneralStatisticsDashlet.php
"SELECT " $select 
                FROM product as p 
                WHERE 
                    (SELECT COUNT(ap.id)                  
                    FROM associated_product AS ap
                      JOIN product AS p_rel 
                        ON p_rel.id = ap.related_product_id AND p_rel.deleted = 0
                      JOIN product AS p_main 
                        ON p_main.id = ap.related_product_id AND p_main.deleted = 0
                      JOIN association 
                        ON association.id = ap.association_id AND association.deleted = 0
                    WHERE ap.deleted = 0 AND  ap.main_product_id = p.id) = 0 
                AND p.deleted = 0 AND p.type IN " 
$this->getProductTypesCondition( )
1
  • /app/Services/GeneralStatisticsDashlet.php
"DELETE FROM tax WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM associated_product WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM measuring_unit WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_attribute_value WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM packaging WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM product WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_attribute_value SET deleted=1 WHERE product_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_category SET deleted=1 WHERE product_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE associated_product SET deleted=1 WHERE main_product_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE associated_product SET deleted=1 WHERE related_product_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM product_attribute_value WHERE deleted=1 AND scope='Channel'"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_attribute_value_channel SET deleted=1 WHERE product_attribute_value_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_attribute_value_channel WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_family_attribute_channel WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM product_category WHERE deleted=1 AND scope='Channel'"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_category_channel SET deleted=1 WHERE product_category_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_category WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_category_channel WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM product_family WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_family_attribute SET deleted=1 WHERE product_family_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_family WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"SELECT id FROM product_family_attribute WHERE deleted=1 AND scope='Channel'"
1
  • /app/Listeners/TreoCleanupJob.php
"UPDATE product_family_attribute_channel SET deleted=1 WHERE product_family_attribute_id IN ('$ids')"
1
  • /app/Listeners/TreoCleanupJob.php
"DELETE FROM product_family_attribute WHERE deleted=1"
1
  • /app/Listeners/TreoCleanupJob.php
"INSERT INTO product_image_product (product_id,product_image_id,sort_order,scope) VALUES ('" $image['productId'] . "', '" $newImage->get('id') . "', '" $image['sortOrder'] . "', '" $image['scope'] . "')"
1
  • /app/Migrations/V3Dot10Dot0.php
"INSERT INTO category_image_channel (id,category_id,category_image_id,channel_id) VALUES ('" Util::generateId( ) . "', '" $image['categoryId'] . "', '" $newImage->get('id') . "', '" $row['channelId'] . "')"
1
  • /app/Migrations/V3Dot10Dot0.php
"SELECT $select 
                FROM product p 
                LEFT JOIN product_category_linker pc ON pc.product_id=p.id AND pc.deleted=0
                WHERE p.deleted=0 
                  AND p.type IN 
$types
                  AND pc.id IS NULL"
1
  • /app/Services/GeneralStatisticsDashlet.php
"DELETE FROM scheduled_job WHERE job='PimCleanup'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM asset_relation WHERE asset_id IN ({$assetIds})"
1
  • /app/Migrations/V3Dot12Dot0.php
"SHOW TABLES LIKE 'asset_meta_data'"
1
  • /app/Migrations/V3Dot12Dot0.php
"DELETE FROM asset_meta_data WHERE asset_id IN ({$assetIds})"
1
  • /app/Migrations/V3Dot12Dot0.php
"                
                INSERT INTO pim_image
                (id, name, image_id, deleted, sort_order, scope, assigned_user_id, product_id, category_id)
                SELECT
                    SUBSTR(MD5(CONCAT(ar.id, RAND())), 16) as id,
                    a.name,
                    a.file_id AS image_id,
                    a.deleted,
                    CASE
                       WHEN ar.sort_order IS NOT NULL THEN ar.sort_order
                       ELSE (SELECT @n := @n + CASE 
                                                WHEN max(ar1.sort_order) is not null 
                                                THEN max(ar1.sort_order) 
                                                ELSE 1 END
                             FROM asset_relation AS ar1,
                                  (SELECT @n := 1) s
                             WHERE ar1.entity_id = ar.entity_id)
                       END AS sort_order,
                    ar.scope,
                    ar.assigned_user_id,
                    
{$select}
                FROM asset AS a
                         RIGHT JOIN asset_relation AS ar
                                    ON a.id = ar.asset_id
                                        AND ar.deleted = 0
                                        AND ar.entity_name = '
{$entityName}'
                         RIGHT JOIN attachment AS att ON a.file_id = att.id AND att.deleted = 0
                WHERE a.type = 'Gallery Image'
                    AND a.deleted = 0
                  AND a.id IN (
{$assetIds});"
1
  • /app/Migrations/V3Dot12Dot0.php
"UPDATE {$table} p
                RIGHT JOIN (SELECT pim_image.
$fieldLink, min(pim_image.sort_order) as sort
                        FROM pim_image
                        WHERE pim_image.deleted = 0 
{$wherePimImage}
                        GROUP BY pim_image.
$fieldLink
                    ) as sort ON sort.
$fieldLink = p.id
                LEFT JOIN pim_image pi ON pi.
$fieldLink = sort.$fieldLink
                              AND pi.sort_order = sort.sort
                              
{$where}
                SET p.image_id = pi.image_id
                WHERE p.deleted = 0;"
1
  • /app/Migrations/V3Dot12Dot0.php
"INSERT INTO pim_image_channel (channel_id, pim_image_id)
                                    SELECT arc.channel_id, pi.id AS pim_image_id
                                    FROM asset AS a
                                             RIGHT JOIN asset_relation ar ON
                                                                ar.asset_id = a.id
                                                            AND ar.deleted = 0
                                                            AND ar.scope = 'Channel'
                                                            AND ar.entity_name = '
{$entityName}'
                                             RIGHT JOIN asset_relation_channel arc
                                                        ON ar.id = arc.asset_relation_id
                                                            AND arc.deleted = 0
                                             LEFT JOIN pim_image pi ON       
                                                                pi.image_id = a.file_id
                                                           AND  pi.deleted = 0
                                                           AND  pi.scope = 'Channel'
                                                           AND  pi.
{$relationAsset} = ar.entity_id
                                    WHERE 
{$where} 
                                        AND a.deleted = 0 
                                        AND a.type = 'Gallery Image' 
                                        AND a.id IN (
{$assetIds});"
1
  • /app/Migrations/V3Dot12Dot0.php
'UPDATE ' $table ' SET ' implode(','$setValues) . " WHERE id = '{$id}'"
1
  • /app/Migrations/V3Dot12Dot0.php
' Update scheduled jobs... '
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM job WHERE name='PimCleanup'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM asset WHERE id IN ({$assetIds});"
1
  • /app/Migrations/V3Dot12Dot0.php
"SELECT * FROM attribute WHERE deleted=0"
1
  • /app/Migrations/V3Dot13Dot0.php
"UPDATE product_attribute_value SET attribute_type='$type', locale=NULL WHERE attribute_id='$attributeId' AND deleted=0"
1
  • /app/Migrations/V3Dot13Dot0.php
"UPDATE product_family_attribute SET attribute_type='$type', locale=NULL WHERE attribute_id='$attributeId' AND deleted=0"
1
  • /app/Migrations/V3Dot13Dot0.php
"INSERT INTO attribute (%s) VALUES (:%s)"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT *, (SELECT GROUP_CONCAT(channel_id ORDER BY channel_id ASC) FROM product_family_attribute_channel WHERE product_family_attribute.id=product_family_attribute_channel.product_family_attribute_id) AS channels FROM product_family_attribute WHERE deleted=0 AND attribute_id='$attributeId'"
1
  • /app/Migrations/V3Dot13Dot0.php
"INSERT INTO product_family_attribute (%s) VALUES (:%s)"
1
  • /app/Migrations/V3Dot13Dot0.php
"INSERT INTO product_family_attribute_channel (channel_id, product_family_attribute_id) VALUES ('$channelId','$newPfaId')"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT *, (SELECT GROUP_CONCAT(channel_id ORDER BY channel_id ASC) FROM product_attribute_value_channel WHERE product_attribute_value.id=product_attribute_value_channel.product_attribute_value_id) AS channels FROM product_attribute_value WHERE deleted=0 AND product_family_attribute_id='$pfaId'"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT *, (SELECT GROUP_CONCAT(channel_id ORDER BY channel_id ASC) FROM product_attribute_value_channel WHERE product_attribute_value.id=product_attribute_value_channel.product_attribute_value_id) AS channels FROM product_attribute_value WHERE deleted=0 AND product_family_attribute_id IS NULL AND attribute_id='$attributeId'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE 
                                    FROM asset_relation_channel 
                                    WHERE asset_relation_id 
                                            IN (SELECT id FROM asset_relation WHERE asset_id IN (
{$assetIds}))"
1
  • /app/Migrations/V3Dot12Dot0.php
"SELECT att.id, att.name, a.private, att.storage_file_path, a.id as asset_id 
                                FROM asset AS a
                                    RIGHT JOIN asset_relation AS ar 
                                        ON a.id = ar.asset_id 
                                            AND ar.deleted = 0 
                                            AND ar.entity_name IN ('Product', 'Category')
                                    RIGHT JOIN attachment AS att 
                                        ON a.file_id = att.id AND att.deleted = 0
                                WHERE a.type = 'Gallery Image' AND a.deleted = 0 AND att.storage = 'DAMUploadDir'"
1
  • /app/Migrations/V3Dot12Dot0.php
"UPDATE product_family_attribute SET deleted=1 WHERE attribute_type IS NULL"
1
  • /app/Migrations/V3Dot13Dot0.php
"UPDATE note SET data='%s' WHERE id='%s' AND deleted=0;"
1
  • /app/Migrations/V2Dot2Dot4.php
"UPDATE attribute SET type='text', is_multilang=1 WHERE type='textMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='wysiwyg', is_multilang=1 WHERE type='wysiwygMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='enum', is_multilang=1 WHERE type='enumMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='multiEnum', is_multilang=1 WHERE type='multiEnumMultiLang'"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='varcharMultiLang' WHERE type='varchar' AND is_multilang=1"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='textMultiLang' WHERE type='text' AND is_multilang=1"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='wysiwygMultiLang' WHERE type='wysiwyg' AND is_multilang=1"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='enumMultiLang' WHERE type='enum' AND is_multilang=1"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE attribute SET type='multiEnumMultiLang' WHERE type='multiEnum' AND is_multilang=1"
1
  • /app/Migrations/V3Dot11Dot20.php
"UPDATE channel_product_attribute_value SET product_attribute_id='$id' WHERE attribute_id='$attributeId' AND product_id='$productId' AND deleted=0;"
1
  • /app/Migrations/V2Dot0Dot1.php
"UPDATE job SET execute_time = :time WHERE job.scheduled_job_id = :idJob AND status = 'Pending';"
1
  • /app/Migrations/V3Dot12Dot0.php
"UPDATE associated_product AS ap SET name=(SELECT name FROM association WHERE id=ap.association_id)"
1
  • /app/Migrations/V3Dot10Dot2.php
"SELECT * FROM product_family_attribute"
1
  • /app/Migrations/V1Dot9Dot1.php
"INSERT INTO product_family_attribute_linker
                            (is_required, product_family_id, attribute_id, is_multi_channel) 
                         VALUES 
                            (
$isRequired, '$productFamilyId', '$attributeId', $isMultiChannel);"
1
  • /app/Migrations/V1Dot9Dot1.php
"DELETE FROM product_family_attribute"
1
  • /app/Migrations/V1Dot9Dot1.php
"SELECT product_id,category_id,sorting FROM product_category WHERE deleted=0"
1
  • /app/Migrations/V3Dot13Dot1.php
"INSERT INTO product_category_linker (product_id,category_id,sorting) VALUES (:product_id,:category_id,:sorting)"
1
  • /app/Migrations/V3Dot13Dot1.php
"SELECT id,product_id,category_id,sorting FROM product_category_linker WHERE deleted=0"
1
  • /app/Migrations/V3Dot13Dot1.php
"INSERT INTO product_category (id,product_id,category_id,sorting) VALUES (:id,:product_id,:category_id,:sorting)"
1
  • /app/Migrations/V3Dot13Dot1.php
"SELECT id FROM scheduled_job WHERE job = 'TreoCleanup' LIMIT 1;"
1
  • /app/Migrations/V3Dot12Dot0.php
"INSERT INTO category_image_category (category_id,category_image_id,sort_order,scope) VALUES ('" $image['categoryId'] . "', '" $newImage->get('id') . "', '" $image['sortOrder'] . "', '" $image['scope'] . "')"
1
  • /app/Migrations/V3Dot10Dot0.php
"UPDATE product_attribute_value SET deleted=1 WHERE attribute_type IS NULL"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT id,name,parent_id,type_value,locale FROM attribute WHERE deleted=0 AND locale IS NOT NULL"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT pfal.*   
                FROM product_family_attribute_linker AS pfal 
                JOIN product_family AS pf ON pf.id=pfal.product_family_id 
                JOIN attribute AS a ON a.id=pfal.attribute_id 
                WHERE pfal.deleted=0 AND pf.deleted=0 AND a.deleted=0"
1
  • /app/Migrations/V3Dot1Dot0.php
"UPDATE attribute SET name_$key='{$attribute['name']}', type_value_$key='{$attribute['type_value']}' WHERE id='{$attribute['parent_id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT DISTINCT channel.id   AS channelId, product.id   AS productId
                 FROM catalog
                 JOIN channel ON channel.catalog_id=catalog.id AND channel.deleted=0
                 JOIN category ON (category.category_route LIKE concat('%|',catalog.category_id,'|%') OR category.id=catalog.category_id) AND category.deleted=0
                 JOIN product_category_linker AS pcl ON pcl.category_id=category.id AND pcl.deleted=0
                 JOIN product ON product.id=pcl.product_id AND product.deleted=0
                 WHERE catalog.deleted=0"
1
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO product_channel (product_id, channel_id) VALUES ('$productId', '$channelId');"
1
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO $tableTo ($fieldsNew)
                    SELECT 
$fieldsOld FROM $tableFrom 
                    WHERE NOT EXISTS (SELECT id FROM 
$tableTo WHERE id = $tableFrom.id);"
1
  • /app/Migrations/V1Dot6Dot1.php
"UPDATE $tableName SET $columnTo = $columnFrom;"
1
  • /app/Migrations/V1Dot6Dot1.php
"SELECT cpav.*, pav.product_id, pav.attribute_id
                FROM channel_product_attribute_value AS cpav
                LEFT JOIN product_attribute_value AS pav ON pav.id=cpav.product_attribute_id AND pav.deleted=0
                WHERE cpav.deleted=0
                  AND pav.product_id IN (SELECT id FROM product WHERE deleted=0)
                  AND cpav.channel_id IN (SELECT id FROM channel WHERE deleted=0)"
1
  • /app/Migrations/V3Dot1Dot0.php
"INSERT INTO product_attribute_value (id,product_id,attribute_id,scope,created_by_id,created_at,$valuesKeys) VALUES ('$id','$productId','$attributeId','Channel','system','$createdAt','$valuesValue');"
1
  • /app/Migrations/V3Dot1Dot0.php
"INSERT INTO product_attribute_value_channel (product_attribute_value_id,channel_id) VALUES ('$id','$channelId');"
1
  • /app/Migrations/V3Dot1Dot0.php
'SELECT 
                   ci.id           AS id,
                   ci.name         AS name, 
                   ci.image_id     AS imageId, 
                   ci.type         AS type, 
                   ci.image_link   AS link, 
                   cic.category_id AS categoryId,  
                   cic.scope       AS scope,
                   cic.sort_order  AS sortOrder,
                   CASE
                        WHEN c.image_id = ci.image_id THEN 1
                        ELSE 0
                    END AS isMain
                FROM category_image_category AS cic 
                JOIN category_image AS ci ON ci.id=cic.category_image_id AND ci.deleted=0
                JOIN category AS c ON cic.category_id=c.id AND c.deleted=0  
                WHERE cic.deleted=0 
                ORDER BY cic.category_id ASC'
1
  • /app/Migrations/V3Dot10Dot0.php
"INSERT INTO catalog_category (catalog_id,category_id) VALUES ('$id','$categoryId');"
1
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO product_family_attribute (id,product_family_id,attribute_id,is_required,scope,created_by_id,created_at) VALUES ('$id','$productFamilyId','$attributeId',$isRequired,'Global','system','$createdAt');"
1
  • /app/Migrations/V3Dot1Dot0.php
"UPDATE product_attribute_value SET product_family_attribute_id='$id', is_required=$isRequired WHERE scope='Global' AND attribute_id='$attributeId' AND product_id IN (SELECT id FROM product WHERE product_family_id='$productFamilyId');"
1
  • /app/Migrations/V3Dot1Dot0.php
"UPDATE product SET type='simpleProduct' WHERE type='bundleProduct'"
1
  • /app/Migrations/V3Dot10Dot1.php
"UPDATE product AS p1 SET p1.measuring_unit_id=(SELECT measuring_unit_id FROM product_type_package WHERE package_product_id=p1.id)"
1
  • /app/Migrations/V3Dot10Dot1.php
"UPDATE product SET type='simpleProduct' WHERE type='packageProduct'"
1
  • /app/Migrations/V3Dot10Dot1.php
'Update complete fields in ' $entityName1
  • /app/Migrations/V3Dot12Dot3.php
"UPDATE channel SET `code` = '%s' WHERE id = '%s';"
1
  • /app/Migrations/V1Dot5Dot5.php
'DELETE FROM pim_image WHERE 1;DELETE FROM pim_image_channel WHERE 1'
1
  • /app/Migrations/V3Dot10Dot0.php
"DELETE FROM product_channel WHERE 1"
1
  • /app/Migrations/V3Dot0Dot1.php
"SELECT id FROM category WHERE category_parent_id IS NULL AND deleted=0"
1
  • /app/Migrations/V3Dot0Dot1.php
'SELECT 
                            channel_id AS channelId
                         FROM product_image_channel
                         WHERE deleted=0
                         AND product_image_id=\'' 
$productImage['id'] . '\'
                         AND product_id=\'' 
$productImage['productId'] . '\''
1
  • /app/Migrations/V3Dot10Dot0.php
"DELETE FROM product_attribute_value_channel WHERE product_attribute_value_id='{$pav['id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM attribute WHERE id='{$attribute['id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM product_family_attribute_channel WHERE product_family_attribute_id IN (SELECT id FROM product_family_attribute WHERE attribute_id='{$attribute['id']}')"
1
  • /app/Migrations/V3Dot13Dot0.php
'SELECT 
                   pi.id          AS id,
                   pi.name        AS name, 
                   pi.image_id    AS imageId, 
                   pi.link        AS link, 
                   pi.category_id AS categoryId,  
                   pi.product_id  AS productId,
                   pi.scope       AS scope,
                   pi.sort_order  AS sortOrder
                FROM pim_image AS pi 
                JOIN attachment AS a ON a.id=pi.image_id AND a.deleted=0
                LEFT JOIN category AS c ON pi.category_id=c.id AND c.deleted=0  
                LEFT JOIN product AS p ON pi.product_id=p.id AND p.deleted=0
                WHERE pi.deleted=0'
1
  • /app/Migrations/V3Dot10Dot0.php
'DELETE FROM category_image WHERE 1;DELETE FROM category_image_category WHERE 1;DELETE FROM category_image_channel WHERE 1'
1
  • /app/Migrations/V3Dot10Dot0.php
"DELETE FROM product_family_attribute WHERE attribute_id='{$attribute['id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
"SELECT id, product_id, locale, locale_parent_id, value FROM product_attribute_value WHERE attribute_id='{$attribute['id']}' AND locale_parent_id IS NOT NULL"
1
  • /app/Migrations/V3Dot13Dot0.php
"UPDATE product_attribute_value SET value_$pavKey='{$pav['value']}' WHERE id='{$pav['locale_parent_id']}' AND product_id='{$pav['product_id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM product_attribute_value WHERE id='{$pav['id']}'"
1
  • /app/Migrations/V3Dot13Dot0.php
'DELETE FROM product_image WHERE 1;DELETE FROM product_image_product WHERE 1;DELETE FROM product_image_channel WHERE 1'
1
  • /app/Migrations/V3Dot10Dot0.php
"UPDATE product SET catalog_id='$id' WHERE 1"
1
  • /app/Migrations/V3Dot0Dot1.php
"SELECT id FROM category WHERE category_parent_id IS NULL"
1
  • /app/Migrations/V3Dot0Dot1.php
"SELECT id FROM catalog"
1
  • /app/Migrations/V3Dot0Dot1.php
'SELECT 
                            channel_id AS channelId
                         FROM category_image_channel
                         WHERE deleted=0
                         AND category_image_id=\'' 
$categoryImage['id'] . '\'
                         AND category_id= \'' 
$categoryImage['categoryId'] . '\''
1
  • /app/Migrations/V3Dot10Dot0.php
"INSERT INTO catalog_category (catalog_id, category_id) VALUES ('" $catalog['id'] . "', '" $category['id'] . "');"
1
  • /app/Migrations/V3Dot0Dot1.php
"SELECT pcl.* 
                FROM product_category_linker AS pcl 
                JOIN product AS p ON p.id=pcl.product_id 
                JOIN category AS c ON c.id=pcl.category_id 
                WHERE pcl.deleted=0 AND p.deleted=0 AND c.deleted=0"
1
  • /app/Migrations/V3Dot0Dot1.php
'DELETE FROM product_category WHERE 1'
1
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO product_category (id,product_id,category_id,scope,created_by_id,created_at) VALUES ('$id','$productId','$categoryId','Global','system','$createdAt');"
1
  • /app/Migrations/V3Dot0Dot1.php
"DELETE FROM catalog WHERE code='main_catalog_migration'"
1
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO catalog (id,name,code,description,is_active,created_by_id,created_at) VALUES ('$id','Main catalog','main_catalog_migration','Auto generated catalog by migration.',1,'system','$createdAt')"
1
  • /app/Migrations/V3Dot0Dot1.php
'SELECT 
                   pi.id          AS id,
                   pi.name        AS name, 
                   pi.image_id    AS imageId, 
                   pi.type        AS type, 
                   pi.image_link  AS link, 
                   pip.product_id AS productId,  
                   pip.scope      AS scope,
                   pip.sort_order AS sortOrder,
                    CASE
                        WHEN p.image_id = pi.image_id THEN 1
                        ELSE 0
                    END AS isMain
                FROM product_image_product AS pip 
                JOIN product_image AS pi ON pi.id=pip.product_image_id AND pi.deleted=0
                JOIN product AS p ON pip.product_id=p.id AND p.deleted=0  
                WHERE pip.deleted=0 
                ORDER BY pip.product_id ASC'
1
  • /app/Migrations/V3Dot10Dot0.php
"INSERT INTO product_attribute_value_channel (channel_id, product_attribute_value_id) VALUES ('$channelId','$id')"
2
  • /app/Repositories/ProductFamilyAttribute.php
  • /app/Repositories/ProductFamilyAttribute.php
' Delete custom layouts for Category and Product... '
2
  • /app/Migrations/V3Dot13Dot1.php
  • /app/Migrations/V3Dot13Dot1.php
' Delete custom layouts for Attribute entity... '
2
  • /app/Migrations/V3Dot13Dot0.php
  • /app/Migrations/V3Dot13Dot0.php
"DELETE FROM catalog_category WHERE 1"
2
  • /app/Migrations/V3Dot0Dot1.php
  • /app/Migrations/V3Dot0Dot1.php
"INSERT INTO product_attribute_value (%s) VALUES (:%s)"
2
  • /app/Migrations/V3Dot13Dot0.php
  • /app/Migrations/V3Dot13Dot0.php
"INSERT INTO product_attribute_value_channel (channel_id, product_attribute_value_id) VALUES ('$channelId','" $newPav['id'] . "')"
2
  • /app/Migrations/V3Dot13Dot0.php
  • /app/Migrations/V3Dot13Dot0.php
'SELECT channel_id AS channelId
                             FROM pim_image_channel
                             WHERE deleted=0 AND pim_image_id=\'' 
$image['id'] . '\''
2
  • /app/Migrations/V3Dot10Dot0.php
  • /app/Migrations/V3Dot10Dot0.php