DELIMITER DLM00

DROP PROCEDURE IF EXISTS upgrade963 DLM00

CREATE PROCEDURE upgrade963()
BEGIN

    IF NOT EXISTS(SELECT * FROM information_schema.`COLUMNS` WHERE `TABLE_SCHEMA` = DATABASE() AND `TABLE_NAME` = 'files_file' AND COLUMN_NAME = 'encrypted') THEN
        ALTER TABLE `files_file` ADD COLUMN `encrypted` INT(1) NOT NULL DEFAULT '0' AFTER `changes`;
    END IF;
	
	INSERT IGNORE INTO core_settings(tenant, id, value) values (-1, 'CompanyWhiteLabelSettings', 0xF547048A4865171587D9CEBC8A496C601D96031F2C1C3E9160353942EE765DACD316F4B5F42892436FC4A21B9A6DF8FFD3BC4036B47E3A5A1B4C881B26609869FEBB6848BD88C02EEAC6A4CCB3E8F404290812F0E6E124A552BE81A58C64BB8BD3C9A8C0EDE1F9421281DE0C7AF82733C0B754E97EFFFA5A75607A91957896CBECF9563FC831300DC8E7C930A55B298EB82D6F69E0ED6E4D8752607F1881F61B032306E0F069A5F69F086A177EB41AC06F889EB0B39CBFD4B5CDB763E996554DEADB9C71CF3EF86F4A0354A864A10639DFD29B5C6D5DCDA9D4B0988EE406948BCB54C6A70ADC6C00577174285CEBCD76);

END DLM00

CALL upgrade963() DLM00

DELIMITER ;