Commit 9cfd5c85 authored by nanahira's avatar nanahira

fix

parent e092fe7e
Pipeline #3089 passed with stages
in 1 minute and 9 seconds
...@@ -32,7 +32,7 @@ export class BotService { ...@@ -32,7 +32,7 @@ export class BotService {
} }
return ent; return ent;
} }
async findOrCreateGroup(id: string, name?: string) { async findOrCreateGroup(id: string) {
const repo = this.db.getRepository(Group); const repo = this.db.getRepository(Group);
let ent = await repo.findOne({ where: { id } }); let ent = await repo.findOne({ where: { id } });
if (ent) { if (ent) {
...@@ -40,7 +40,6 @@ export class BotService { ...@@ -40,7 +40,6 @@ export class BotService {
} }
ent = new Group(); ent = new Group();
ent.id = id; ent.id = id;
ent.name = name;
try { try {
ent = await repo.save(ent); ent = await repo.save(ent);
} catch (e) { } catch (e) {
......
...@@ -4,8 +4,4 @@ import { Column, Index, PrimaryColumn } from 'typeorm'; ...@@ -4,8 +4,4 @@ import { Column, Index, PrimaryColumn } from 'typeorm';
export class QQIDBase extends TimeBase { export class QQIDBase extends TimeBase {
@PrimaryColumn('varchar', { length: 12 }) @PrimaryColumn('varchar', { length: 12 })
id: string; id: string;
@Index()
@Column('varchar', { length: 32, nullable: true })
name: string;
} }
import { QQIDBase } from './QQIDBase'; import { QQIDBase } from './QQIDBase';
import { Entity } from 'typeorm'; import { Column, Entity, Index } from 'typeorm';
@Entity() @Entity()
export class User extends QQIDBase {} export class User extends QQIDBase {
@Index()
@Column('varchar', { length: 32, nullable: true })
name: string;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment