
ALTER TABLE `ACCESS` ADD COLUMN `nomeClasse` VARCHAR(40);

ALTER TABLE `ACCESS` ADD COLUMN `servletPath` VARCHAR(40);

ALTER TABLE `ACCESS` ADD COLUMN `flgMaskType` INTEGER;

ALTER TABLE `ACCESS` ADD COLUMN `id_accessHeader` VARCHAR(30);

# ---------------------------------------------------------------------- #
# Add table "TABLE_DESC"                                                 #
# ---------------------------------------------------------------------- #

CREATE TABLE `TABLE_DESC` (
    `id_tableDesc` INTEGER NOT NULL AUTO_INCREMENT,
    `id_access` VARCHAR(30),
    `nomeColonna` VARCHAR(40),
    `label` VARCHAR(40),
    `flgTipo` INTEGER,
    `flgCR` INTEGER,
    `ordine` INTEGER,
    `rowNumb` INTEGER,
    `colLg` INTEGER,
    `colXs` INTEGER,
    `optionValues` VARCHAR(40),
    `comboDescColumn` VARCHAR(40),
    `ajaxSearchString` VARCHAR(40),
    `ajaxReturnValues` VARCHAR(40),
    `maxLenght` INTEGER,
    CONSTRAINT `PK_TABLE_DESC` PRIMARY KEY (`id_tableDesc`)
);

ALTER TABLE `ACCESS` ADD CONSTRAINT `ACCESS_ACCESS` 
    FOREIGN KEY (`id_accessHeader`) REFERENCES `ACCESS` (`id_access`);

ALTER TABLE `TABLE_DESC` ADD CONSTRAINT `ACCESS_TABLE_DESC` 
    FOREIGN KEY (`id_access`) REFERENCES `ACCESS` (`id_access`);

CREATE UNIQUE INDEX `IDX_TABLE_DESC_1` ON `TABLE_DESC` (`id_access`,`nomeColonna`);


ALTER TABLE `TABLE_DESC` ADD COLUMN `flgHidden` INTEGER;

ALTER TABLE `TABLE_DESC` MODIFY `flgHidden` INTEGER AFTER `label`;



ALTER TABLE `TABLE_DESC` ADD COLUMN `ordineCR` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `rowNumbCR` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `colLgCr` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `colXsCr` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `numColSearch` INTEGER;

ALTER TABLE `TABLE_DESC` MODIFY `ordineCR` INTEGER AFTER `flgCR`;

ALTER TABLE `TABLE_DESC` MODIFY `rowNumbCR` INTEGER AFTER `ordineCR`;

ALTER TABLE `TABLE_DESC` MODIFY `colLgCr` INTEGER AFTER `rowNumbCR`;

ALTER TABLE `TABLE_DESC` MODIFY `colXsCr` INTEGER AFTER `colLgCr`;

ALTER TABLE `TABLE_DESC` MODIFY `numColSearch` INTEGER AFTER `colXsCr`;


ALTER TABLE `TABLE_DESC` ADD COLUMN `flgPk` INTEGER;

ALTER TABLE `TABLE_DESC` MODIFY `flgPk` INTEGER AFTER `label`;



ALTER TABLE `TABLE_DESC` ADD COLUMN `flgFormField` INTEGER;

ALTER TABLE `TABLE_DESC` MODIFY `flgFormField` INTEGER AFTER `flgTipo`;


ALTER TABLE `TABLE_DESC` CHANGE `optionValues` `comboFlgValuelist` VARCHAR(40);


ALTER TABLE `TABLE_DESC` MODIFY `label` VARCHAR(60);

ALTER TABLE `TABLE_DESC` MODIFY `comboFlgValuelist` VARCHAR(300);

ALTER TABLE `TABLE_DESC` MODIFY `comboDescColumn` VARCHAR(60);

ALTER TABLE `TABLE_DESC` MODIFY `ajaxSearchString` VARCHAR(300);

ALTER TABLE `TABLE_DESC` MODIFY `ajaxReturnValues` VARCHAR(300);


ALTER TABLE `TABLE_DESC` CHANGE `colLgCr` `colLgCR` INTEGER;

ALTER TABLE `TABLE_DESC` CHANGE `colXsCr` `colXsCR` INTEGER;


ALTER TABLE `TABLE_DESC` ADD COLUMN `flgReadOnly` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `tabName` VARCHAR(40);

ALTER TABLE `TABLE_DESC` ADD COLUMN `tabOrder` INTEGER;



ALTER TABLE `ACCESS` ADD COLUMN `flgLock` INTEGER;



# ---------------------------------------------------------------------- #
# Alter table "ACCESS"                                                   #
# ---------------------------------------------------------------------- #

ALTER TABLE `ACCESS` ADD COLUMN `flgCombo` INTEGER;

ALTER TABLE `ACCESS` ADD COLUMN `comboDescColumn` VARCHAR(60);

ALTER TABLE `ACCESS` ADD COLUMN `comboFlgValuelist` VARCHAR(300);

ALTER TABLE `ACCESS` ADD COLUMN `ajaxSearchServlet` VARCHAR(40);

ALTER TABLE `ACCESS` ADD COLUMN `ajstReturnFields` VARCHAR(200);

ALTER TABLE `ACCESS` CHANGE `flgLock` `flgAuto` INTEGER;

# ---------------------------------------------------------------------- #
# Alter table "TABLE_DESC"                                               #
# ---------------------------------------------------------------------- #

ALTER TABLE `TABLE_DESC` DROP COLUMN `comboFlgValuelist`;

ALTER TABLE `TABLE_DESC` DROP COLUMN `comboDescColumn`;

ALTER TABLE `TABLE_DESC` DROP COLUMN `ajaxReturnValues`;

ALTER TABLE `TABLE_DESC` ADD COLUMN `flgRequired` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `ajaxFieldsMapping` VARCHAR(200);

# ---------------------------------------------------------------------- #
# Alter table "ACCESS"                                                   #
# ---------------------------------------------------------------------- #

ALTER TABLE `ACCESS` DROP COLUMN `comboFlgValuelist`;

# ---------------------------------------------------------------------- #
# Alter table "TABLE_DESC"                                               #
# ---------------------------------------------------------------------- #

ALTER TABLE `TABLE_DESC` ADD COLUMN `comboFlgValuelist` VARCHAR(300);


# ---------------------------------------------------------------------- #
# Alter table "ACCESS"                                                   #
# ---------------------------------------------------------------------- #

ALTER TABLE `ACCESS` ADD COLUMN `help` VARCHAR(10000);

# ---------------------------------------------------------------------- #
# Alter table "TABLE_DESC"                                               #
# ---------------------------------------------------------------------- #

ALTER TABLE `TABLE_DESC` ADD COLUMN `toolTip` VARCHAR(100);

ALTER TABLE `TABLE_DESC` ADD COLUMN `flgHtml` INTEGER;



ALTER TABLE `ACCESS` ADD COLUMN `flgAutoCR` INTEGER;

ALTER TABLE `ACCESS` ADD COLUMN `flgAutoAJST` INTEGER;

ALTER TABLE `ACCESS` ADD COLUMN `flgAutoPD` INTEGER;

ALTER TABLE `ACCESS` DROP COLUMN `flgAuto` ;

ALTER TABLE `ACCESS` MODIFY `help` VARCHAR(10000);

######à

ALTER TABLE `TABLE_DESC` ADD COLUMN `ajaxNChar` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `ajaxNextAction` VARCHAR(40);

ALTER TABLE `TABLE_DESC` ADD COLUMN `flgAjaxUseSubmit` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `flgAjaxUseMono` INTEGER;

ALTER TABLE `TABLE_DESC` ADD COLUMN `ajaxJavascriptmodify` VARCHAR(40);

ALTER TABLE `TABLE_DESC` ADD COLUMN `ajaxJavascriptnew` VARCHAR(40);



ALTER TABLE `ACCESS` ADD COLUMN `flgRicercaSearchTxt` INTEGER;