Fix requires

This commit is contained in:
baz 2023-12-18 21:55:20 +00:00
parent 7c27191202
commit 2e4e68a82b
2 changed files with 5 additions and 26 deletions

View File

@ -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');

View File

@ -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');