Compare commits

..

No commits in common. "e2d3881cce22d10d86893cf6b4195d84dda9724c" and "1529dcca8f135e1e13f3ce47b5a420729f875353" have entirely different histories.

6 changed files with 4 additions and 66 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
node_modules node_modules
.env .env
config.json config.json
*.sqlite .sqlite

View File

@ -1,20 +0,0 @@
const Sequelize = require('sequelize');
const sequelize = new Sequelize('database', 'username', 'password', {
host: 'localhost',
dialect: 'sqlite',
logging: false,
storage: 'database.sqlite',
});
const db = require('./models/games.js')(sequelize, Sequelize.DataTypes);
require('./models/users.js')(sequelize, Sequelize.DataTypes);
require('models/beatenGames.js')(sequelize, Sequelize.DataTypes);
const force = process.argv.includes('--force') || process.argv.includes('-f');
sequelize.sync({ force }).then(async () => {
// await Promise.all();
console.log('Database synced');
sequelize.close();
}).catch(console.error);

View File

@ -17,7 +17,9 @@ async function getCoverURL(id) {
url = 'https:'.concat(response[0].url); url = 'https:'.concat(response[0].url);
} }
}) })
.then(url = url.replace('t_thumb', 't_1080p_2x')) .then(response => {
url = url.replace('t_thumb', 't_1080p_2x');
})
.catch(err => { .catch(err => {
console.error(err); console.error(err);
}); });

View File

@ -1,16 +0,0 @@
module.exports = (sequelize, DataTypes) => {
return sequelize.define('beatenGames', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
autoIncrement: true,
},
user_id: DataTypes.INTEGER,
game_id: DataTypes.STRING,
date_created: DataTypes.DATE,
date_last_modified: DataTypes.DATE,
}, {
timestamps: false,
});
};

View File

@ -1,14 +0,0 @@
module.exports = (sequelize, DataTypes) => {
return sequelize.define('games', {
id: {
type: DataTypes.INTEGER,
primaryKey: true,
},
name: {
type: DataTypes.STRING,
unique: false,
},
}, {
timestamps: false,
});
};

View File

@ -1,14 +0,0 @@
module.exports = (sequelize, DataTypes) => {
return sequelize.define('users', {
user_id: {
type: DataTypes.STRING,
primaryKey: true,
},
username: {
type: DataTypes.STRING,
allowNull: false,
},
}, {
timestamps: false,
});
};