12 |
} |
} |
13 |
|
|
14 |
async run(client: DiscordClient, argv: string[], args: string[]) { |
async run(client: DiscordClient, argv: string[], args: string[]) { |
15 |
const files = await readdir(path.join(client.rootdir, '/src/models')); |
const files = await readdir(path.join(__dirname, '/../../models')); |
16 |
|
|
17 |
for await (const file of files) { |
for await (const file of files) { |
18 |
if (file === '..' || file === '.') |
if (file === '..' || file === '.') |
19 |
continue; |
continue; |
20 |
|
|
21 |
const { default: model } = await import(path.join(client.rootdir, '/src/models', file)); |
const { default: model } = await import(path.join(__dirname, '/../../models', file)); |
22 |
await model.sync({ |
await model.sync({ |
23 |
logging: console.log |
logging: console.log |
24 |
}); |
}); |