()
| 476 | const createThreadOptions = { forceAddMembers: true }; |
| 477 | |
| 478 | async function createThreads() { |
| 479 | const isAuthoritative = await isAuthoritativeKeyserver(); |
| 480 | |
| 481 | if (!isAuthoritative) { |
| 482 | return; |
| 483 | } |
| 484 | |
| 485 | const insertIDsPromise = dbQuery(SQL` |
| 486 | INSERT INTO ids (id, table_name) |
| 487 | VALUES |
| 488 | (${genesis().id}, 'threads'), |
| 489 | (${bots.commbot.staffThreadID}, 'threads') |
| 490 | `); |
| 491 | |
| 492 | const admin = await thisKeyserverAdmin(); |
| 493 | |
| 494 | const ashoatViewer = createScriptViewer(admin.id); |
| 495 | const createGenesisPromise = createThread( |
| 496 | ashoatViewer, |
| 497 | { |
| 498 | id: genesis().id, |
| 499 | type: threadTypes.GENESIS, |
| 500 | name: genesis().name, |
| 501 | description: genesis().description, |
| 502 | initialMemberIDs: [bots.commbot.userID], |
| 503 | }, |
| 504 | createThreadOptions, |
| 505 | ); |
| 506 | await Promise.all([insertIDsPromise, createGenesisPromise]); |
| 507 | |
| 508 | const commbotViewer = createScriptViewer(bots.commbot.userID); |
| 509 | await createThread( |
| 510 | commbotViewer, |
| 511 | { |
| 512 | id: bots.commbot.staffThreadID, |
| 513 | type: threadTypes.COMMUNITY_SECRET_SUBTHREAD, |
| 514 | initialMemberIDs: [admin.id], |
| 515 | }, |
| 516 | createThreadOptions, |
| 517 | ); |
| 518 | } |
| 519 | |
| 520 | async function setUpMetadataTable() { |
| 521 | await updateDBVersion(newDatabaseVersion); |
no test coverage detected