| 184 | } |
| 185 | |
| 186 | const askForConfirmation = async (): Promise<boolean> => { |
| 187 | const readline = createInterface({ |
| 188 | input: process.stdin, |
| 189 | output: process.stdout, |
| 190 | }) |
| 191 | |
| 192 | const answer = await new Promise<string>((resolve) => { |
| 193 | readline.question("Type 'DELETE' to confirm: ", (input) => resolve(input)) |
| 194 | }) |
| 195 | |
| 196 | readline.close() |
| 197 | return answer.trim() === 'DELETE' |
| 198 | } |
| 199 | |
| 200 | const runAllDelete = async (dbClient: Knex): Promise<boolean> => { |
| 201 | const hasEventTagsTable = await dbClient.schema.hasTable('event_tags') |