fix: toolsが動かないのを修正 (#8008)

* Move tools

* Fix DB
This commit is contained in:
MeiMei 2021-11-26 13:41:49 +09:00 committed by GitHub
parent b4ebf254c8
commit d9775c147f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 14 additions and 9 deletions

View file

@ -1,7 +1,10 @@
import { Emojis } from '@/models/index';
import { initDb } from '@/db/postgre';
import { genId } from '@/misc/gen-id';
async function main(name: string, url: string, alias?: string): Promise<any> {
await initDb();
const { Emojis } = await import('@/models/index');
const aliases = alias != null ? [ alias ] : [];
await Emojis.save({