--
-- $Id$
--
-- Aanpassingen om DB37z (accept) naar de definitieve DB37 te brengen
-- Merk op dat de recreate er nog bij komt die de DB-version bijwerkt

DEFINE thisfile = 'DB37zto37.sql'
DEFINE dbuser   = '*'

SET ECHO ON
SET DEFINE ON
COLUMN fcltlogfile NEW_VALUE fcltlogfile NOPRINT;
WHENEVER SQLERROR EXIT;
SELECT adm.scriptspoolfile('&dbuser', '&thisfile') AS fcltlogfile FROM DUAL;
WHENEVER SQLERROR CONTINUE;
SPOOL &fcltlogfile
SET DEFINE OFF

------ payload begin ------

--/////////////////////////////////////////////////////////////////////////////////////////// STAM#58066
ALTER TABLE mld_stdmelding
 DROP CONSTRAINT mld_c_alg_org_objniveau;

ALTER TABLE mld_stdmelding
  ADD CONSTRAINT mld_c_alg_org_objniveau CHECK (alg_org_obj_niveau IN (-1,0,1,2,3,4,5,8,9));

UPDATE mld_stdmelding
   SET mld_stdmelding_prsafdobj = 1;

--/////////////////////////////////////////////////////////////////////////////////////////// FCLT#58872
ALTER TABLE cnt_disc_params
        MODIFY cnt_disc_params_leverancier
        DEFAULT 0;
ALTER TABLE cnt_disc_params
        MODIFY cnt_disc_params_uitvoerende
        DEFAULT 0;
ALTER TABLE cnt_disc_params
        MODIFY cnt_disc_params_huurder
        DEFAULT 0;

--/////////////////////////////////////////////////////////////////////////////////////////// FCLT#53579
INSERT INTO fac_menu
(fac_menu_volgnr, fac_menu_altlabel, fac_menu_info, fac_menu_alturl, fac_menu_altgroep, fac_functie_key)
SELECT 99160, 'lcl_menu_fac_refresh_accept', '', 'appl/fac/fac_refresh_accept.asp', 2, fac_functie_key
  FROM fac_functie
 WHERE fac_functie_code = 'WEB_FACFAC'
   AND NOT EXISTS (SELECT ''
                     FROM fac_menu
                    WHERE fac_menu_alturl = 'appl/fac/fac_refresh_accept.asp'
                  );


------ payload end   ------

SET DEFINE OFF
BEGIN adm.systrackscriptId ('$Id$', 1); END;
/

COMMIT;
SET ECHO OFF
SPOOL OFF
SET DEFINE ON
PROMPT Logfile of this upgrade is: &fcltlogfile
