[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Noalyss-commit] [noalyss] 09/17: FInal : add SQL upgrade script + test
From: |
Dany De Bontridder |
Subject: |
[Noalyss-commit] [noalyss] 09/17: FInal : add SQL upgrade script + test |
Date: |
Tue, 16 May 2023 14:50:12 -0400 (EDT) |
sparkyx pushed a commit to branch master
in repository noalyss.
commit 0eaf7eb8365fefb10f1fb4f690fe0dbabe438053
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sun Apr 30 19:09:26 2023 +0200
FInal : add SQL upgrade script + test
---
include/constant.php | 2 +-
.../sql/patch/upgrade184.sql | 4 ++
sql/upgrade.sql | 46 ----------------------
unit-test/create-dossier-test.sh | 4 +-
...edger_sale.Test.php => acc_ledger_saleTest.php} | 0
5 files changed, 7 insertions(+), 49 deletions(-)
diff --git a/include/constant.php b/include/constant.php
index 6cc75512c..4e258c43a 100644
--- a/include/constant.php
+++ b/include/constant.php
@@ -116,7 +116,7 @@ if (!defined("NOALYSS_PACKAGE_REPOSITORY")) {
if (!defined("SYSINFO_DISPLAY")) {
define("SYSINFO_DISPLAY", TRUE);
}
-define("DBVERSION", 184);
+define("DBVERSION", 185);
define("MONO_DATABASE", 25);
define("DBVERSIONREPO", 20);
define('NOTFOUND', '--not found--');
diff --git a/sql/upgrade.sql b/include/sql/patch/upgrade184.sql
similarity index 93%
copy from sql/upgrade.sql
copy to include/sql/patch/upgrade184.sql
index d167abe17..9f4028126 100644
--- a/sql/upgrade.sql
+++ b/include/sql/patch/upgrade184.sql
@@ -1,3 +1,5 @@
+begin;
+
update menu_ref set me_menu='Journal' where me_code='CFGLED';
CREATE OR REPLACE FUNCTION comptaproc.four_upper_letter()
@@ -44,3 +46,5 @@ INSERT INTO document_component (dc_comment, dc_code)
VALUES('Gestion', 'GES');
ALTER TABLE public.document_modele ADD CONSTRAINT document_modele_fk FOREIGN
KEY (md_affect) REFERENCES public.document_component(dc_code) ON UPDATE CASCADE;
+insert into version (val,v_description) values (185,'Document Component : Type
of Document Model in a table');
+commit;
\ No newline at end of file
diff --git a/sql/upgrade.sql b/sql/upgrade.sql
index d167abe17..e69de29bb 100644
--- a/sql/upgrade.sql
+++ b/sql/upgrade.sql
@@ -1,46 +0,0 @@
-update menu_ref set me_menu='Journal' where me_code='CFGLED';
-
-CREATE OR REPLACE FUNCTION comptaproc.four_upper_letter()
- RETURNS trigger
-AS $function$
-begin
- new.dc_code=transform_to_code(new.dc_code);
- new.dc_code:=substr(new.dc_code,1,4);
- return new;
-END;
-$function$
-LANGUAGE plpgsql;
-
-COMMENT ON FUNCTION comptaproc.four_upper_letter() IS 'Cut to the 4 first
letter in uppercase';
-
-
-DROP TABLE if exists document_component ;
-
-CREATE TABLE document_component (
- dc_id int4 NOT NULL GENERATED BY DEFAULT
AS IDENTITY, -- PK
- dc_code text NOT NULL, -- Code used in
document_modele
- dc_comment text not null , -- description
- CONSTRAINT document_component_pk PRIMARY
KEY (dc_id),
- CONSTRAINT document_component_un UNIQUE
(dc_code)
-);
-COMMENT ON TABLE public.document_component IS 'Give the component of NOALYSS
that is using is';
-
--- Column comments
-
-COMMENT ON COLUMN public.document_component.dc_id IS 'PK';
-COMMENT ON COLUMN public.document_component.dc_code IS 'Code used in
document_modele';
-COMMENT ON COLUMN public.document_component.dc_comment IS 'Code used in
document_modele';
-
--- Table Triggers
-
-create trigger t_code before insert
- or update on
- public.document_component for each row execute function
comptaproc.four_upper_letter();
-
-
-INSERT INTO document_component (dc_comment, dc_code) VALUES('Journaux achat',
'ACH');
-INSERT INTO document_component (dc_comment, dc_code) VALUES('Journaux vente',
'VEN');
-INSERT INTO document_component (dc_comment, dc_code) VALUES('Gestion', 'GES');
-
-ALTER TABLE public.document_modele ADD CONSTRAINT document_modele_fk FOREIGN
KEY (md_affect) REFERENCES public.document_component(dc_code) ON UPDATE CASCADE;
-
diff --git a/unit-test/create-dossier-test.sh b/unit-test/create-dossier-test.sh
index 3360797a9..fb5a27541 100755
--- a/unit-test/create-dossier-test.sh
+++ b/unit-test/create-dossier-test.sh
@@ -1,7 +1,7 @@
#!/bin/bash
-export PGCLUSTER=10/main
-DOSSIER_TEST=rel70dossier25
+export PGCLUSTER=12/main
+DOSSIER_TEST=rel91dossier25
FILE_TEST=dossier25.sql
dropdb $DOSSIER_TEST
diff --git a/unit-test/include/class/acc_ledger_sale.Test.php
b/unit-test/include/class/acc_ledger_saleTest.php
similarity index 100%
rename from unit-test/include/class/acc_ledger_sale.Test.php
rename to unit-test/include/class/acc_ledger_saleTest.php
- [Noalyss-commit] [noalyss] 01/17: Cosmetic, (continued)
- [Noalyss-commit] [noalyss] 01/17: Cosmetic, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 13/17: missing file, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 03/17: Task #2257:improve Détail Action dans le tableau de bord , mise à jour, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 07/17: remove dead code, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 06/17: Document Template, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 11/17: remove dead code, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 10/17: Bug#2271: Banque : totaux non vérifié, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 02/17: Code Documentation, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 14/17: Bug#2271: Banque : totaux non vérifié,arrondi, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 04/17: Compatibility 8.1, Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 09/17: FInal : add SQL upgrade script + test,
Dany De Bontridder <=
- [Noalyss-commit] [noalyss] 17/17: Merge branch 'devel-venus2', Dany De Bontridder, 2023/05/16
- [Noalyss-commit] [noalyss] 16/17: Fix bug : background color not set for head on small screens, Dany De Bontridder, 2023/05/16