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
5 changed files with 14 additions and 9 deletions

View File

@@ -1,13 +1,11 @@
import { initDb } from '../db/postgre';
import { getRepository } from 'typeorm';
import { User } from '@/models/entities/user';
async function main(username: string) {
if (!username) throw `username required`;
username = username.replace(/^@/, '');
await initDb();
const Users = getRepository(User);
const { Users } = await import('@/models/index');
const res = await Users.update({
usernameLower: username.toLowerCase(),