Fix debug project categories

This commit is contained in:
Laurent Destailleur 2016-08-29 17:30:54 +02:00
parent 64351f3428
commit c49c23df3d
2 changed files with 19 additions and 3 deletions

View File

@ -458,7 +458,7 @@ class Categorie extends CommonObject
$this->db->begin();
/* FIX #1317 : Check for child cat and move up 1 level*/
/* FIX #1317 : Check for child category and move up 1 level*/
if (! $error)
{
$sql = "UPDATE ".MAIN_DB_PREFIX."categorie";
@ -524,7 +524,7 @@ class Categorie extends CommonObject
if (! $error)
{
$sql = "DELETE FROM ".MAIN_DB_PREFIX."categorie_project";
$sql .= " WHERE fk_category = ".$this->id;
$sql .= " WHERE fk_categorie = ".$this->id;
if (!$this->db->query($sql))
{
$this->error=$this->db->lasterror();

View File

@ -46,4 +46,20 @@ ALTER TABLE llx_notify ADD COLUMN type_target varchar(16) NULL;
ALTER TABLE llx_entrepot DROP COLUMN valo_pmp;
ALTER TABLE llx_notify_def MODIFY COLUMN fk_soc integer NULL;
-- VPGSQL8.2 ALTER TABLE llx_notify_def ALTER COLUMN fk_soc SET DEFAULT NULL;
-- VPGSQL8.2 ALTER TABLE llx_notify_def ALTER COLUMN fk_soc SET DEFAULT NULL;
create table llx_categorie_project
(
fk_categorie integer NOT NULL,
fk_project integer NOT NULL,
import_key varchar(14)
)ENGINE=innodb;
ALTER TABLE llx_categorie_project ADD PRIMARY KEY pk_categorie_project (fk_categorie, fk_project);
ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_categorie (fk_categorie);
ALTER TABLE llx_categorie_project ADD INDEX idx_categorie_project_fk_project (fk_project);
ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_categorie_rowid FOREIGN KEY (fk_categorie) REFERENCES llx_categorie (rowid);
ALTER TABLE llx_categorie_project ADD CONSTRAINT fk_categorie_project_fk_project_rowid FOREIGN KEY (fk_project) REFERENCES llx_projet (rowid);