Files
template-web-astro/src/commands/Migrations/current.ts
Florian Bouillon bc97d9106b
Some checks failed
Build, check & Test / run (push) Failing after 1m45s
Lint / run (push) Failing after 48s
Build Docker Image / build_docker (push) Failing after 3m18s
feat: Filemagedon
Signed-off-by: Avior <git@avior.me>
2024-09-11 14:38:58 +02:00

22 lines
501 B
TypeScript

import type { Command } from 'commands'
import DaoFactory from 'models/DaoFactory'
const command: Command = {
name: 'migrations:current',
description: 'Get the current version of the database',
async run() {
const client = await DaoFactory.client()
await client.connect()
const ver = await client.getVersion()
if (ver < 0) {
console.log('no database :(')
} else {
console.log(`Current database version: ${new Date(ver)}`)
}
return {
code: 0
}
},
}
export default command