Удобно смотрим phistory

Материал из MajorDoMo инфо

Для более удобного просмотра и чистки phistory в phpMyAdmin делаем представление

Создаем представление ("вьюху")

CREATE OR REPLACE VIEW vw_phistory AS
SELECT
	`h`.`ADDED` AS `ADDED`,		
	`h`.`VALUE` AS `VALUE`,
	`p`.`TITLE` AS `property`,
    `o`.`TITLE` AS `object`,
    `c`.`TITLE` AS `class`,
    `cp`.`TITLE` AS `class_parent`,
    `cpp`.`TITLE` AS `class_pparent`

FROM
    (
        (
            (
                (
                    (
                        `db_terminal`.`phistory` `h`
                    JOIN `db_terminal`.`pvalues` `v`
                    ON
                        (`h`.`VALUE_ID` = `v`.`ID`)					
                        
                    LEFT JOIN `db_terminal`.`properties` `p`
                    ON
                        (`v`.`PROPERTY_ID` = `p`.`ID`)
                    	
                    )
                JOIN `db_terminal`.`objects` `o`
                ON
                    (`v`.`OBJECT_ID` = `o`.`ID`)
                )
            LEFT JOIN `db_terminal`.`classes` `c`
            ON
                (`o`.`CLASS_ID` = `c`.`ID`)
            )
        LEFT JOIN `db_terminal`.`classes` `cp`
        ON
            (`c`.`PARENT_ID` = `cp`.`ID`)
        )
    LEFT JOIN `db_terminal`.`classes` `cpp`
    ON
        (`cp`.`PARENT_ID` = `cpp`.`ID`)

    )