99c26db777
* init migration * WIP position calculations * view retrieval sorting * WIP specific position resolution * position calc * new positioning draft * workz? * improved error * even better logging * moar * troubleshooting * works?? * delete junk * fixed rebalancing * some tests * lint fix * test fix * more fixes and tests * more tests and fixes * fix testsss * more tests * moaar * fix group drop * errorToString updates
26 lines
834 B
TypeScript
26 lines
834 B
TypeScript
import { cliLogger as logger } from '@/observability/logging'
|
|
import type { CommonDbArgs } from '@/modules/cli/commands/db/helpers'
|
|
import { getTargettedDbClients } from '@/modules/cli/commands/db/helpers'
|
|
import type { CommandModule } from 'yargs'
|
|
|
|
const command: CommandModule<unknown, CommonDbArgs> = {
|
|
command: 'latest',
|
|
describe: 'Run all migrations that have not yet been run',
|
|
async handler(argv) {
|
|
logger.info('Running latest migrations on DB instances!')
|
|
const { regionKey } = argv
|
|
|
|
const dbs = await getTargettedDbClients({ regionKey })
|
|
logger.info(`Found ${dbs.length} DB(s) to run latest on`)
|
|
|
|
for (const db of dbs) {
|
|
logger.info(`Running latest on DB ${db.regionKey}...`)
|
|
await db.client.migrate.latest()
|
|
}
|
|
|
|
logger.info('Completed running migration')
|
|
}
|
|
}
|
|
|
|
export = command
|