This commit is contained in:
peter
2020-02-05 17:04:10 +01:00
parent afbf1cc001
commit 5cf7a25e77
75 changed files with 2244 additions and 758 deletions
+11 -5
View File
@@ -11,7 +11,7 @@ import { GuildManager } from '../Components/Guild/GuildManager';
import { ItemManager } from '../Components/Item/ItemManager';
import { RaidManager } from '../Components/Raid/RaidManager';
import { CharacterManager } from '../Components/Character/CharacterManager';
import { LoginManager } from '../Components/Login/LoginManager';
import { UserManager } from '../Components/User/UserManager';
import { RootComponent } from '../Injector/ServiceDecorator';
import { TableDefinitionExporter } from '../Types/Interfaces';
import { AdminConf, TableDefiniton } from '../Types/Types';
@@ -19,18 +19,20 @@ import { RPCConfigLoader } from '../Components/RPCConfigLoader';
import { FrontworkComponent } from '../Types/FrontworkComponent';
import { IAdmin } from './Interface';
import { Injector } from '../Injector/Injector';
import { Shoutbox } from '../Components/Shoutbox/Shoutbox';
const logger = getLogger("admin", 'debug')
@RootComponent({
implements: IAdmin,
imports: [
injectable: IAdmin,
injects: [
GuildManager,
ItemManager,
RaidManager,
CharacterManager,
LoginManager
UserManager,
Shoutbox
]
})
export class FrontworkAdmin
@@ -169,7 +171,11 @@ implements TableDefinitionExporter, IAdmin {
}
this.knex = Knex(conf)
if(conf.client === 'sqlite3'){
await this.knex.raw('PRAGMA foreign_keys = ON');
}
await Promise.all(
this.getTableDefinitions()
//make unique by name