#!/usr/bin/env bash

# Copyright © 2012-2026 ScriptFanix
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License.

# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
# GNU General Public License for more details.

# A copy of the GNU General Public License v3 is includded in the LICENSE file
# at the root of the project.

upgradedatabase_7_8() {
	echo "Upgrading database to version 8... (backup is $database.bak_v7)"
	cp "$database" "$database.bak_v7"
	# This migration only contains a user notice; no schema changes needed.
	# The bug fixed in v8 was that old destination files were not being
	# deleted on disk correctly; users must run 'cleandestinations -r' to clean up.
	echo 'Deletion of old files was failing. Users of previous versions (YOU!) are strongly advised to run cleandestinations with the "-r" flag.'
	read -p "Press Enter to continue..."
	Update atom version 8 <<<"1 = 1"
}
