public function createPropertyValuesProxyTable($group, $dropExisting = true) {

        $group = strtolower($group);
        if (!empty($group)) :
            $this->database->query("DROP TABLE IF EXISTS `?{$group}_property_values`;");
            $this->database->query(
                "CREATE TABLE IF NOT EXISTS `?{$group}_property_values` (
                   `value_id` mediumint(11) NOT NULL AUTO_INCREMENT,
                   `value_data` text NOT NULL,
                   `value_updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
                   `property_id` int(11) NOT NULL,
                   `object_id` int(11) NOT NULL,
                   PRIMARY KEY (`value_id`),
                   UNIQUE KEY `object_property_uid` (`object_id`,`property_id`),
                   KEY `property_id_idxfk` (`property_id`),
                   KEY `object_id_idxfk` (`object_id`)
                 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;"
            );

            $this->database->query("DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_insert`;");
            $this->database->query(
                "CREATE TRIGGER `?{$group}_property_value_validate_insert` BEFORE INSERT ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;"
            );

            $this->database->query("DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_update`;");
            $this->database->query(
                "CREATE TRIGGER `?{$group}_property_value_validate_update` BEFORE UPDATE ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;"
            );

            //Add reference constrains
            $this->database->query(
                "ALTER TABLE `?{$group}_property_values`
                    ADD CONSTRAINT `{$group}_property_values_ibfk_1` FOREIGN KEY (`object_id`) REFERENCES `?objects` (`object_id`),
                    ADD CONSTRAINT `{$group}_property_values_ibfk_2` FOREIGN KEY (`property_id`) REFERENCES `?properties` (`property_id`) ON DELETE CASCADE;"
            );
        endif;
    }
public function createPropertyValuesProxyTable($group, $dropExisting = true) {

        $group = strtolower($group);
        if (!empty($group)) :
            $this->database->query("DROP TABLE IF EXISTS `?{$group}_property_values`;");
            $this->database->query(
                "CREATE TABLE IF NOT EXISTS `?{$group}_property_values` (
                   `value_id` mediumint(11) NOT NULL AUTO_INCREMENT,
                   `value_data` text NOT NULL,
                   `value_updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
                   `property_id` int(11) NOT NULL,
                   `object_id` int(11) NOT NULL,
                   PRIMARY KEY (`value_id`),
                   UNIQUE KEY `object_property_uid` (`object_id`,`property_id`),
                   KEY `property_id_idxfk` (`property_id`),
                   KEY `object_id_idxfk` (`object_id`)
                 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;"
            );

            $this->database->query("DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_insert`;");
            $this->database->query(
                "CREATE TRIGGER `?{$group}_property_value_validate_insert` BEFORE INSERT ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;"
            );

            $this->database->query("DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_update`;");
            $this->database->query(
                "CREATE TRIGGER `?{$group}_property_value_validate_update` BEFORE UPDATE ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;"
            );

            //Add reference constrains
            $this->database->query(
                "ALTER TABLE `?{$group}_property_values`
                    ADD CONSTRAINT `{$group}_property_values_ibfk_1` FOREIGN KEY (`object_id`) REFERENCES `?objects` (`object_id`),
                    ADD CONSTRAINT `{$group}_property_values_ibfk_2` FOREIGN KEY (`property_id`) REFERENCES `?properties` (`property_id`) ON DELETE CASCADE;"
            );
        endif;
    }
public function createPropertyValuesProxyTable ( $ group , $ dropExisting = true ) { $ group = strtolower ( $ group ) ; if ( ! empty ( $ group ) ) : $ this -> database -> query ( "DROP TABLE IF EXISTS `?{$group}_property_values`;" ) ; $ this -> database -> query ( "CREATE TABLE IF NOT EXISTS `?{$group}_property_values` (
                   `value_id` mediumint(11) NOT NULL AUTO_INCREMENT,
                   `value_data` text NOT NULL,
                   `value_updated_on` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
                   `property_id` int(11) NOT NULL,
                   `object_id` int(11) NOT NULL,
                   PRIMARY KEY (`value_id`),
                   UNIQUE KEY `object_property_uid` (`object_id`,`property_id`),
                   KEY `property_id_idxfk` (`property_id`),
                   KEY `object_id_idxfk` (`object_id`)
                 ) ENGINE=InnoDB  DEFAULT CHARSET=utf8;" ) ; $ this -> database -> query ( "DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_insert`;" ) ; $ this -> database -> query ( "CREATE TRIGGER `?{$group}_property_value_validate_insert` BEFORE INSERT ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;" ) ; $ this -> database -> query ( "DROP TRIGGER IF EXISTS `?{$group}_property_value_validate_update`;" ) ; $ this -> database -> query ( "CREATE TRIGGER `?{$group}_property_value_validate_update` BEFORE UPDATE ON `?{$group}_property_values`
                    FOR EACH ROW
                    BEGIN
                        CALL ?property_value_validate(NEW.property_id, NEW.value_data);
                    END;" ) ; //Add reference constrains $ this -> database -> query ( "ALTER TABLE `?{$group}_property_values`
                    ADD CONSTRAINT `{$group}_property_values_ibfk_1` FOREIGN KEY (`object_id`) REFERENCES `?objects` (`object_id`),
                    ADD CONSTRAINT `{$group}_property_values_ibfk_2` FOREIGN KEY (`property_id`) REFERENCES `?properties` (`property_id`) ON DELETE CASCADE;" ) ; endif ; }
Query for creating property values by proxy table
@param string $group
@return void
Query for creating property values by proxy table