75aa5d9b2d
* feat(multiregion): replace user replication * chore(multiregion): optimise replication * maybe it's this * postgres is fun * once more * chore(multiregion): only replicate test user creation during multiregion tests * feat: improved replicate_query logic * fix: minor * fix: starting issue * feat: included user create and delete specs to multiregion * feat: removed console logs * fix: user defaults * fix: multiregion test helper * fix: update scenarios for users * refactor(multiregion): swap replicateQuery concept to asMultiregionOperation (#5301) feat(multiregion): introduced asMultregionOperator, refactor test to user builder classes * chore: renamings * fix: remove comments * feat: remove user replication * refactor: simplified spec usages * chore: comments * chore: branches and favs * chore: more tests * chore: more tests * fix linting * fix tests * feat: dropping replication * refactor: moved project delete to service * fix: comment * feat: updateStreamFactory and updateProjectFacotry * deleteProjectFactory + replicateFactory * deleteWorkspaceFactory * fix: selector * fix: tests * fix tests, finished createStreamFactory * feat: simplify changes * fix: remove comment * fix: minor strucutres * fix: moveProjectToRegion * fix: moved branch creation outside of multiregion scope * fix: branch creation * fix: tests * fix: ci tests * fix: removed log form test * fix: on specs, no random regionKeys * feat: simplify ci for postgres * try: fix health check * feat: fixed tests in ci * try: entrypoint * try: entrypoint * try: entrypoint * try: POSTGRES_INITDB_ARGS * feat: apply POSTGRES_INITDB_ARGS to all server tests * fix: broken test * fix: reinstate max health attempts * fix: after merge * fix: after merge --------- Co-authored-by: Charles Driesler <chuck@speckle.systems>
25 lines
755 B
TypeScript
25 lines
755 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: 'rollback',
|
|
describe: 'Roll back all migrations',
|
|
async handler(argv) {
|
|
const { regionKey } = argv
|
|
|
|
logger.info('Rolling back migrations...')
|
|
|
|
const dbs = await getTargettedDbClients({ regionKey })
|
|
for (const db of dbs) {
|
|
logger.info(`Rolling back DB ${db.regionKey}...`)
|
|
await db.client.migrate.rollback(undefined, true)
|
|
}
|
|
|
|
logger.info('Completed rolling back migrations')
|
|
}
|
|
}
|
|
|
|
export = command
|