Fix: pgsql compatibility

This commit is contained in:
Laurent Destailleur 2012-03-03 16:53:21 +01:00
parent 6d8c1bf7c6
commit 4f1a49bd42
2 changed files with 3 additions and 1 deletions

View File

@ -131,7 +131,8 @@ ALTER TABLE llx_categorie_societe DROP INDEX fk_categorie;
ALTER TABLE llx_categorie_societe DROP INDEX fk_societe;
ALTER TABLE llx_categorie_fournisseur DROP INDEX fk_categorie;
ALTER TABLE llx_categorie_fournisseur DROP PRIMARY KEY;
-- VMYSQL ALTER TABLE llx_categorie_fournisseur DROP PRIMARY KEY;
-- VPGSQL ALTER TABLE llx_categorie_fournisseur DROP CONSTRAINT pk_categorie_fournisseur;
ALTER TABLE llx_categorie_fournisseur ADD PRIMARY KEY pk_categorie_fournisseur (fk_categorie, fk_societe);
ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_fournisseur ADD INDEX idx_categorie_fournisseur_fk_societe (fk_societe);

View File

@ -34,6 +34,7 @@ update llx_facture_rec set fk_projet = null where fk_projet not in (select rowid
update llx_fichinter set fk_projet = null where fk_projet not in (select rowid from llx_projet);
update llx_projet_task set fk_projet = null where fk_projet not in (select rowid from llx_projet);
DELETE FROM llx_boxes where box_id NOT IN (SELECT rowid FROM llx_boxes_def);
-- VMYSQL4.1 DELETE T1 FROM llx_boxes_def as T1, llx_boxes_def as T2 where T1.entity = T2.entity AND T1.file = T2.file AND T1.note = T2.note and T1.rowid > T2.rowid
-- VPGSQL8.2 DELETE FROM llx_boxes_def as T1 WHERE rowid NOT IN (SELECT min(rowid) FROM llx_boxes_def GROUP BY file, entity, note)