# Dumped update query (to manually run in the database console)
UPDATE `chv_settings` SET `setting_value` = 1 WHERE `setting_name` = 'maintenance';
ALTER TABLE `chv_albums` MODIFY `album_user_id` bigint(32) DEFAULT NULL;
ALTER TABLE `chv_images` MODIFY `image_size` bigint(11) UNSIGNED NOT NULL;
ALTER TABLE `chv_images` MODIFY `image_type` tinyint(3) UNSIGNED as (case
when `image_extension` in ('pdf','doc','md') then 4
when `image_extension` in ('mp3','m4a','wav') then 3
when `image_extension` in ('mp4','webm','mov') then 2
when `image_extension` in ('avif','jpg','jpeg','gif','png','webp') then 1
else 0 end) stored;
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('crypt_salt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'crypt_salt'), 'string');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('chevereto_version_installed', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'chevereto_version_installed'), 'string');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('last_used_storage', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'last_used_storage'), 'int');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
[/SPOILER]
VALUES('id_padding', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'id_padding'), 'int');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('update_check_datetimegmt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'update_check_datetimegmt'), 'string');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('update_check_notified_release', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'update_check_notified_release'), 'string');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('chevereto_news', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'chevereto_news'), 'array');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('cron_last_ran', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'cron_last_ran'), 'string');
INSERT IGNORE INTO `chv_variables` (variable_name, variable_value, variable_type)
VALUES('news_check_datetimegmt', (SELECT `setting_value` FROM `chv_settings` WHERE `setting_name` = 'news_check_datetimegmt'), 'string');
UPDATE `chv_settings` SET `setting_value` = 0 WHERE `setting_name` = "maintenance";