This file contains hidden or 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
-- Delete products | |
DELETE relations.*, taxes.*, terms.* | |
FROM wp_term_relationships AS relations | |
INNER JOIN wp_term_taxonomy AS taxes | |
ON relations.term_taxonomy_id=taxes.term_taxonomy_id | |
INNER JOIN wp_terms AS terms | |
ON taxes.term_id=terms.term_id | |
WHERE object_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation')); | |
DELETE FROM wp_postmeta WHERE post_id IN (SELECT ID FROM wp_posts WHERE post_type IN ('product','product_variation')); |
This file contains hidden or 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
convert original.jpg +profile icm -profile JapanColor2001Coated.icc -profile AdobeRGB1998.icc output.jpg |
This file contains hidden or 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 script changes sequences with OWNED BY to the table and column they're | |
-- referenced from. NB! Sequences that are referenced by multiple tables or columns are ignored. | |
SELECT 'ALTER SEQUENCE '|| quote_ident(min(schema_name)) ||'.'|| quote_ident(min(seq_name)) | |
||' OWNED BY '|| quote_ident(min(table_name)) ||'.'|| quote_ident(min(column_name)) ||';' | |
FROM ( | |
SELECT | |
n.nspname AS schema_name, | |
c.relname AS table_name, | |
a.attname AS column_name, |
This file contains hidden or 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
public funtion executeIndex(sfWebRequest $request) | |
{ | |
// if we want browser to opt file download | |
$this->getResponse()->setHttpHeader('Content-Disposition', 'attachment; filename="file.txt"'); | |
// set content type (text/csv, text/plain ..) | |
$this->getResponse()->setContentType('text/plain'); | |
// return string immediately, don't try to render template | |
return $this->renderText($text); |
This file contains hidden or 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
DELETE FROM duptest | |
WHERE name_key NOT IN | |
(SELECT MAX(dt.name_key) | |
FROM duptest As dt | |
GROUP BY dt.first_name, dt.last_name); |