Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion engine/migrations/migration_helper.cc
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,15 @@ cpp::result<bool, std::string> MigrationHelper::BackupDatabase(
try {
SQLite::Database src_db(src_db_path, SQLite::OPEN_READONLY);
sqlite3* backup_db;

#if defined(_WIN32)
if (sqlite3_open16(backup_db_path.c_str(), &backup_db) != SQLITE_OK) {
throw std::runtime_error("Failed to open backup database");
}
#else
if (sqlite3_open(backup_db_path.c_str(), &backup_db) != SQLITE_OK) {
throw std::runtime_error("Failed to open backup database");
}
#endif

sqlite3_backup* backup =
sqlite3_backup_init(backup_db, "main", src_db.getHandle(), "main");
Expand Down