Fix requires
This commit is contained in:
parent
7c27191202
commit
2e4e68a82b
|
@ -9,7 +9,7 @@ const sequelize = new Sequelize('database', 'username', 'password', {
|
||||||
|
|
||||||
const db = require('./models/games.js')(sequelize, Sequelize.DataTypes);
|
const db = require('./models/games.js')(sequelize, Sequelize.DataTypes);
|
||||||
require('./models/users.js')(sequelize, Sequelize.DataTypes);
|
require('./models/users.js')(sequelize, Sequelize.DataTypes);
|
||||||
require('models/beatenGames.js')(sequelize, Sequelize.DataTypes);
|
require('./models/beatenGames.js')(sequelize, Sequelize.DataTypes);
|
||||||
|
|
||||||
const force = process.argv.includes('--force') || process.argv.includes('-f');
|
const force = process.argv.includes('--force') || process.argv.includes('-f');
|
||||||
|
|
||||||
|
|
29
index.js
29
index.js
|
@ -50,30 +50,9 @@ for (const file of eventFiles) {
|
||||||
|
|
||||||
client.login(process.env.token);
|
client.login(process.env.token);
|
||||||
|
|
||||||
const { Sequelize } = require('sequelize');
|
|
||||||
|
|
||||||
const sequelize = new Sequelize('database', 'user', 'password', {
|
|
||||||
host: 'localhost',
|
|
||||||
dialect: 'sqlite',
|
|
||||||
logging: false,
|
|
||||||
storage: 'database.sqlite',
|
|
||||||
});
|
|
||||||
|
|
||||||
const Tags = sequelize.define('tags', {
|
|
||||||
name: {
|
|
||||||
type: Sequelize.STRING,
|
|
||||||
unique: true,
|
|
||||||
},
|
|
||||||
description: Sequelize.TEXT,
|
|
||||||
username: Sequelize.STRING,
|
|
||||||
usage_count: {
|
|
||||||
type: Sequelize.INTEGER,
|
|
||||||
defaultValue: 0,
|
|
||||||
allowNull: false,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
client.once(Events.ClientReady, () => {
|
client.once(Events.ClientReady, () => {
|
||||||
Tags.sync({ force: true });
|
|
||||||
console.log(`Logged in as ${client.user.tag}!`);
|
console.log(`Logged in as ${client.user.tag}!`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
require('sequelize');
|
||||||
|
require('./dbObjects.js');
|
Loading…
Reference in New Issue