[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 50/65: Fix SQL upgrade
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 50/65: Fix SQL upgrade |
Date: |
Wed, 09 Sep 2015 08:27:29 +0000 |
sparkyx pushed a commit to branch master
in repository noalyss.
commit b4652751579d26b3899990716bba62ae4f143bbf
Author: Dany De Bontridder <address@hidden>
Date: Sun Sep 6 07:06:15 2015 +0200
Fix SQL upgrade
---
html/admin/sql/patch/upgrade120.sql | 14 ++++++++++----
sql/upgrade.sql | 9 ++++++++-
2 files changed, 18 insertions(+), 5 deletions(-)
diff --git a/html/admin/sql/patch/upgrade120.sql
b/html/admin/sql/patch/upgrade120.sql
index be27190..1eb7daf 100644
--- a/html/admin/sql/patch/upgrade120.sql
+++ b/html/admin/sql/patch/upgrade120.sql
@@ -173,18 +173,24 @@ begin
('CONTACT',
'contact.inc.php',
'Contact','Liste de vos contacts','ME','Liste de vos contacts
normalement liée à des fiches de sociétés');
-
+ end if;
+
+ select count(*) into n_count from profile_menu where me_code='CONTACT' and
p_id=1;
+ if n_count = 0 then
insert into
profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
select 'CONTACT','GESTION',1,22,'E',0,(select pm_id from profile_menu where
me_code='GESTION' and p_id=1);
+ end if;
+
+ select count(*) into n_count from profile_menu where me_code='CONTACT' and
p_id=2;
+ if n_count = 0 then
insert into
profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
select 'CONTACT','GESTION',2,22,'E',0,(select pm_id from profile_menu where
me_code='GESTION' and p_id=2);
end if;
end;
$BODY$
-language plpgsql;
+LANGUAGE plpgsql;
select insert_menu();
drop function insert_menu();
-
drop view v_all_menu;
CREATE OR REPLACE VIEW v_all_menu AS
@@ -266,7 +272,7 @@ begin
return;
end;
$BODY$
- LANGUAGE plpgsql;
+LANGUAGE plpgsql;
update version set val=121;
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index 8edf7df..3516c8a 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -172,8 +172,15 @@ begin
('CONTACT',
'contact.inc.php',
'Contact','Liste de vos contacts','ME','Liste de vos contacts
normalement liée à des fiches de sociétés');
-
+ end if;
+
+ select count(*) into n_count from profile_menu where me_code='CONTACT' and
p_id=1;
+ if n_count = 0 then
insert into
profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
select 'CONTACT','GESTION',1,22,'E',0,(select pm_id from profile_menu where
me_code='GESTION' and p_id=1);
+ end if;
+
+ select count(*) into n_count from profile_menu where me_code='CONTACT' and
p_id=2;
+ if n_count = 0 then
insert into
profile_menu(me_code,me_code_dep,p_id,p_order,p_type_display,pm_default,pm_id_dep)
select 'CONTACT','GESTION',2,22,'E',0,(select pm_id from profile_menu where
me_code='GESTION' and p_id=2);
end if;
end;
- [Noalyss-commit] [noalyss] 42/65: Remove ENABLE_CACHE, (continued)
- [Noalyss-commit] [noalyss] 42/65: Remove ENABLE_CACHE, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 43/65: set version, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 41/65: database upgrade, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 47/65: avoid duplicate, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 45/65: database upgrade : if empty, skipped, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 46/65: drop view before recreating it, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 44/65: database upgrade, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 48/65: drop view before recreating it, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 49/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 26/65: update translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 50/65: Fix SQL upgrade,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 52/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 51/65: Correct Add category, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 32/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 55/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 58/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 57/65: translation, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 60/65: Set properly the error log, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 54/65: translation + indent, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 61/65: Set properly the error log, Dany De Bontridder, 2015/09/09
- [Noalyss-commit] [noalyss] 62/65: Set properly the error log, Dany De Bontridder, 2015/09/09