mirror of
https://github.com/ZeppelinBot/Zeppelin.git
synced 2025-07-07 11:07:19 +00:00
feat: upgrade to TypeORM 0.3
This commit is contained in:
parent
8cee4ec1e4
commit
761ff27771
57 changed files with 412 additions and 325 deletions
|
@ -1,6 +1,6 @@
|
|||
import { getRepository, Repository } from "typeorm";
|
||||
import { Repository } from "typeorm";
|
||||
import { BaseGuildRepository } from "./BaseGuildRepository";
|
||||
import { connection } from "./db";
|
||||
import { dataSource } from "./dataSource";
|
||||
import { RoleQueueItem } from "./entities/RoleQueueItem";
|
||||
|
||||
export class GuildRoleQueue extends BaseGuildRepository {
|
||||
|
@ -8,11 +8,11 @@ export class GuildRoleQueue extends BaseGuildRepository {
|
|||
|
||||
constructor(guildId) {
|
||||
super(guildId);
|
||||
this.roleQueue = getRepository(RoleQueueItem);
|
||||
this.roleQueue = dataSource.getRepository(RoleQueueItem);
|
||||
}
|
||||
|
||||
consumeNextRoleAssignments(count: number): Promise<RoleQueueItem[]> {
|
||||
return connection.transaction(async (entityManager) => {
|
||||
return dataSource.transaction(async (entityManager) => {
|
||||
const repository = entityManager.getRepository(RoleQueueItem);
|
||||
|
||||
const nextAssignments = await repository
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue