(path: string, journal: MigrationJournal)
| 1154 | const migrationJournalPath = (sqlitePath: string): string => `${sqlitePath}.v1-v2-migration.json`; |
| 1155 | |
| 1156 | const writeMigrationJournal = async (path: string, journal: MigrationJournal): Promise<void> => { |
| 1157 | fs.mkdirSync(dirname(path), { recursive: true }); |
| 1158 | const tmp = `${path}.tmp-${journal.nonce}`; |
| 1159 | fs.writeFileSync(tmp, `${JSON.stringify(journal, null, 2)}\n`, { mode: 0o600 }); |
| 1160 | fsyncFileIfExists(tmp); |
| 1161 | await renameWithRetry(tmp, path); |
| 1162 | fsyncDirectory(dirname(path)); |
| 1163 | }; |
| 1164 | |
| 1165 | const removeMigrationJournal = (path: string): void => { |
| 1166 | fs.rmSync(path, { force: true }); |
no test coverage detected