For the archive_year function, check if we're in debug or not to perform the right query for the right db